Class: ChartMogul::Import::Invoice
- Inherits:
-
Object
- Object
- ChartMogul::Import::Invoice
- Defined in:
- lib/chart_mogul/import/invoice.rb
Defined Under Namespace
Classes: LineItem, Transaction
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#due_date ⇒ Object
readonly
Returns the value of attribute due_date.
-
#external_id ⇒ Object
readonly
Returns the value of attribute external_id.
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
-
#transactions ⇒ Object
readonly
Returns the value of attribute transactions.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(args) ⇒ Invoice
constructor
A new instance of Invoice.
Constructor Details
#initialize(args) ⇒ Invoice
Returns a new instance of Invoice.
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/chart_mogul/import/invoice.rb', line 61 def initialize(args) @uuid = args[:uuid] @external_id = args[:external_id] @currency = args[:currency] @date = Time.parse(args[:date]) if args[:date] @due_date = Time.parse(args[:due_date]) if args[:due_date] @line_items = args[:line_items].map { |li| LineItem.new(li) } @transactions = args[:transactions].map { |li| Transaction.new(li) } end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
8 9 10 |
# File 'lib/chart_mogul/import/invoice.rb', line 8 def currency @currency end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/chart_mogul/import/invoice.rb', line 6 def date @date end |
#due_date ⇒ Object (readonly)
Returns the value of attribute due_date.
9 10 11 |
# File 'lib/chart_mogul/import/invoice.rb', line 9 def due_date @due_date end |
#external_id ⇒ Object (readonly)
Returns the value of attribute external_id.
7 8 9 |
# File 'lib/chart_mogul/import/invoice.rb', line 7 def external_id @external_id end |
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items.
10 11 12 |
# File 'lib/chart_mogul/import/invoice.rb', line 10 def line_items @line_items end |
#transactions ⇒ Object (readonly)
Returns the value of attribute transactions.
11 12 13 |
# File 'lib/chart_mogul/import/invoice.rb', line 11 def transactions @transactions end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/chart_mogul/import/invoice.rb', line 5 def uuid @uuid end |