Method: LEWT::LEWTLedger#initialize
- Defined in:
- lib/lewt_ledger.rb
#initialize(args) ⇒ LEWTLedger
Returns a new instance of LEWTLedger.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/lewt_ledger.rb', line 43 def initialize (args) raise ArgumentError, "#{self.class.name} was not instantized with valid parameters" if valid?(args) == false self[:date_start] = args[:date_start] self[:date_end] = args[:date_end] self[:category] = args[:category] self[:entity] = args[:entity] self[:description] = args[:description] self[:quantity] = args[:quantity] self[:unit_cost] = args[:unit_cost] self[:sub_total] = self[:sub_total] || self[:quantity] * self[:unit_cost] self[:gst] = args[:gst] || 0 self[:total] = args[:total] || ( self[:sub_total] + self[:gst] ) @metatags = (:description) if @metatags != nil end |