Class: FarmingEngineers::Invoices::Common::LineItem

Inherits:
HistoryItem
  • Object
show all
Defined in:
lib/farming_engineers/invoices/common.rb

Instance Attribute Summary

Attributes inherited from HistoryItem

#date, #description, #quantity, #total

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ LineItem

Returns a new instance of LineItem.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/farming_engineers/invoices/common.rb', line 19

def initialize(*args)
  case args.first
  when Hash
    args = args.first
    @date = args[:date]
    @description = args[:description]
    @quantity = args[:quantity]
    @total = args[:total]
  else
    @date, @description, @quantity, @total = args
  end
end