Module: Stall::Models::LineItem
- Extended by:
- ActiveSupport::Concern
- Included in:
- LineItem
- Defined in:
- app/models/stall/models/line_item.rb
Instance Method Summary collapse
Instance Method Details
#currency ⇒ Object
43 44 45 |
# File 'app/models/stall/models/line_item.rb', line 43 def currency product_list.try(:currency) || Money.default_currency end |
#like?(other) ⇒ Boolean
37 38 39 40 41 |
# File 'app/models/stall/models/line_item.rb', line 37 def like?(other) [:sellable_id, :sellable_type].all? do |property| public_send(property) == other.public_send(property) end end |
#total_weight ⇒ Object
51 52 53 |
# File 'app/models/stall/models/line_item.rb', line 51 def total_weight weight * quantity end |