Class: ChartMogul::Import::Invoice

Inherits:
Object
  • Object
show all
Defined in:
lib/chart_mogul/import/invoice.rb

Defined Under Namespace

Classes: LineItem, Transaction

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#currencyObject (readonly)

Returns the value of attribute currency.



8
9
10
# File 'lib/chart_mogul/import/invoice.rb', line 8

def currency
  @currency
end

#dateObject (readonly)

Returns the value of attribute date.



6
7
8
# File 'lib/chart_mogul/import/invoice.rb', line 6

def date
  @date
end

#due_dateObject (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_idObject (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_itemsObject (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

#transactionsObject (readonly)

Returns the value of attribute transactions.



11
12
13
# File 'lib/chart_mogul/import/invoice.rb', line 11

def transactions
  @transactions
end

#uuidObject (readonly)

Returns the value of attribute uuid.



5
6
7
# File 'lib/chart_mogul/import/invoice.rb', line 5

def uuid
  @uuid
end