Class: LEWT::SimpleInvoices
- Defined in:
- lib/extensions/simple-invoices.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from Extension
#command_name, #customers, #enterprise, #lewt_settings, #lewt_stash, #options
Instance Method Summary collapse
-
#initialize ⇒ SimpleInvoices
constructor
Sets up this extensions command.
-
#process(options, data) ⇒ Object
Processes the provided extract data into an invoice for the given targets.
Methods inherited from Extension
#get_matched_customers, #lewt_extensions
Constructor Details
#initialize ⇒ SimpleInvoices
Sets up this extensions command
18 19 20 |
# File 'lib/extensions/simple-invoices.rb', line 18 def initialize super({:cmd => "invoice"}) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
15 16 17 |
# File 'lib/extensions/simple-invoices.rb', line 15 def data @data end |
Instance Method Details
#process(options, data) ⇒ Object
Processes the provided extract data into an invoice for the given targets.
- options [Hash]
-
An hash containing run-time options passed to this extension by LEWT.
- data [LEWTBook]
-
A hash-like object containing all the extracted data in the LEWTLedger format.
returns [Array]: The invoice data as an array of hashes.
26 27 28 29 30 31 32 33 |
# File 'lib/extensions/simple-invoices.rb', line 26 def process ( , data ) matchData = get_matched_customers( [:target] ) bills = Array.new matchData.each do |client| bills.push( generateBill( client, data) ) end return bills end |