Class: IFormat::OrderItem
- Inherits:
-
Base
- Object
- Base
- IFormat::OrderItem
show all
- Defined in:
- lib/iformat/order_item.rb
Instance Attribute Summary
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
Methods inherited from Base
#[], #initialize, lazy_attr_reader
Constructor Details
This class inherits a constructor from IFormat::Base
Instance Method Details
#==(other) ⇒ Boolean
18
19
20
|
# File 'lib/iformat/order_item.rb', line 18
def ==(other)
super || (other.class == self.class && other.product_id == self.product_id && other.issue_id == self.issue_id && other.type_id == self.type_id)
end
|
#net_amount ⇒ Object
12
13
14
|
# File 'lib/iformat/order_item.rb', line 12
def net_amount
@net_amount ||= BigDecimal.new(@attrs[:price] || '0')
end
|
#type ⇒ Object
8
9
10
|
# File 'lib/iformat/order_item.rb', line 8
def type
@type ||= @attrs[:type_id]
end
|