class LabelMe::Order::LineItem

Attributes

code[RW]
number[RW]
quantity[RW]
unit_price[RW]

Public Class Methods

new(row) click to toggle source
# File lib/label_me/order/line_item.rb, line 4
def initialize(row)
  @number     = row.line_item_id.to_i
  @quantity   = row.line_item_quantity.to_i
  @unit_price = row.line_item_unit_price.to_i
  @code       = row.line_item_code
end

Public Instance Methods

===(other) click to toggle source
# File lib/label_me/order/line_item.rb, line 25
def ===(other)
  self.number == other.number
end
to_hash() click to toggle source
# File lib/label_me/order/line_item.rb, line 16
def to_hash
  {
    number:     number,
    quantity:   quantity,
    unit_price: unit_price,
    code:       code
  }
end