Class: ShellDataReportingApIs::MonthlyInvoiceTrend
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::MonthlyInvoiceTrend
- Defined in:
- lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb
Overview
MonthlyInvoiceTrend Model.
Instance Attribute Summary collapse
-
#currency_code ⇒ String
ISO code of invoice currency.
-
#currency_symbol ⇒ String
Symbol of invoice currency.
-
#month ⇒ Integer
Month.
-
#total_net_amount ⇒ Float
Total net amount invoiced in this month.
-
#total_vat_amount ⇒ Float
Total VAT amount invoiced in this month.
-
#year ⇒ Integer
Year.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(currency_code = SKIP, currency_symbol = SKIP, month = SKIP, total_net_amount = SKIP, total_vat_amount = SKIP, year = SKIP) ⇒ MonthlyInvoiceTrend
constructor
A new instance of MonthlyInvoiceTrend.
Methods inherited from BaseModel
Constructor Details
#initialize(currency_code = SKIP, currency_symbol = SKIP, month = SKIP, total_net_amount = SKIP, total_vat_amount = SKIP, year = SKIP) ⇒ MonthlyInvoiceTrend
Returns a new instance of MonthlyInvoiceTrend.
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 74 def initialize(currency_code = SKIP, currency_symbol = SKIP, month = SKIP, total_net_amount = SKIP, total_vat_amount = SKIP, year = SKIP) @currency_code = currency_code unless currency_code == SKIP @currency_symbol = currency_symbol unless currency_symbol == SKIP @month = month unless month == SKIP @total_net_amount = total_net_amount unless total_net_amount == SKIP @total_vat_amount = total_vat_amount unless total_vat_amount == SKIP @year = year unless year == SKIP end |
Instance Attribute Details
#currency_code ⇒ String
ISO code of invoice currency. Example: EUR
15 16 17 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 15 def currency_code @currency_code end |
#currency_symbol ⇒ String
Symbol of invoice currency. Example: €
20 21 22 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 20 def currency_symbol @currency_symbol end |
#month ⇒ Integer
Month.
24 25 26 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 24 def month @month end |
#total_net_amount ⇒ Float
Total net amount invoiced in this month.
28 29 30 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 28 def total_net_amount @total_net_amount end |
#total_vat_amount ⇒ Float
Total VAT amount invoiced in this month.
32 33 34 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 32 def total_vat_amount @total_vat_amount end |
#year ⇒ Integer
Year.
36 37 38 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 36 def year @year end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 86 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP currency_symbol = hash.key?('CurrencySymbol') ? hash['CurrencySymbol'] : SKIP month = hash.key?('Month') ? hash['Month'] : SKIP total_net_amount = hash.key?('TotalNetAmount') ? hash['TotalNetAmount'] : SKIP total_vat_amount = hash.key?('TotalVATAmount') ? hash['TotalVATAmount'] : SKIP year = hash.key?('Year') ? hash['Year'] : SKIP # Create object from extracted values. MonthlyInvoiceTrend.new(currency_code, currency_symbol, month, total_net_amount, total_vat_amount, year) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['currency_code'] = 'CurrencyCode' @_hash['currency_symbol'] = 'CurrencySymbol' @_hash['month'] = 'Month' @_hash['total_net_amount'] = 'TotalNetAmount' @_hash['total_vat_amount'] = 'TotalVATAmount' @_hash['year'] = 'Year' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 63 def self.nullables %w[ currency_code currency_symbol month total_net_amount total_vat_amount year ] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb', line 51 def self.optionals %w[ currency_code currency_symbol month total_net_amount total_vat_amount year ] end |