Class: Paymill::Invoice

Inherits:
Object
  • Object
show all
Defined in:
lib/paymill/models/invoice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Invoice

Returns a new instance of Invoice.



7
8
9
10
11
12
13
14
15
# File 'lib/paymill/models/invoice.rb', line 7

def initialize( json )
  json.each_pair do |key, value|
    instance_variable_set( "@#{key}", ( Integer( value ) rescue value ) )
  end
  @period_from &&= Time.at( @period_from )
  @period_until &&= Time.at( @period_until )
  @billing_date &&= Time.at( @billing_date )
  @last_reminder_date &&= Time.at( @last_reminder_date )
end

Instance Attribute Details

#billing_dateObject

Returns the value of attribute billing_date.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def billing_date
  @billing_date
end

#bruttoObject

Returns the value of attribute brutto.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def brutto
  @brutto
end

#currencyObject

Returns the value of attribute currency.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def currency
  @currency
end

#invoice_nrObject

Returns the value of attribute invoice_nr.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def invoice_nr
  @invoice_nr
end

#invoice_typeObject

Returns the value of attribute invoice_type.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def invoice_type
  @invoice_type
end

#last_reminder_dateObject

Returns the value of attribute last_reminder_date.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def last_reminder_date
  @last_reminder_date
end

#nettoObject

Returns the value of attribute netto.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def netto
  @netto
end

#period_fromObject

Returns the value of attribute period_from.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def period_from
  @period_from
end

#period_untilObject

Returns the value of attribute period_until.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def period_until
  @period_until
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def status
  @status
end

#vat_rateObject

Returns the value of attribute vat_rate.



4
5
6
# File 'lib/paymill/models/invoice.rb', line 4

def vat_rate
  @vat_rate
end