Class: ShellDataReportingApIs::FinanceCurrency
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::FinanceCurrency
- Defined in:
- lib/shell_data_reporting_ap_is/models/finance_currency.rb
Overview
This entity will not be present in the response if the ‘IncludeFinanceCurrency’ flag in the request is ‘false’
Instance Attribute Summary collapse
-
#credit_limit_exchange_rate ⇒ Float
Factor to be used for converting the amounts in credit limit currency to finance widget currency.
-
#currency_code ⇒ String
Currency ISO Code used for the Finance Widget.
-
#currency_symbol ⇒ String
Currency Symbol.
-
#invoice_exchange_rate ⇒ Float
Factor to be used for converting the amounts in invoice currency to finance widget currency.
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, invoice_exchange_rate = SKIP, credit_limit_exchange_rate = SKIP) ⇒ FinanceCurrency
constructor
A new instance of FinanceCurrency.
Methods inherited from BaseModel
Constructor Details
#initialize(currency_code = SKIP, currency_symbol = SKIP, invoice_exchange_rate = SKIP, credit_limit_exchange_rate = SKIP) ⇒ FinanceCurrency
Returns a new instance of FinanceCurrency.
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 65 def initialize(currency_code = SKIP, currency_symbol = SKIP, invoice_exchange_rate = SKIP, credit_limit_exchange_rate = SKIP) @currency_code = currency_code unless currency_code == SKIP @currency_symbol = currency_symbol unless currency_symbol == SKIP @invoice_exchange_rate = invoice_exchange_rate unless invoice_exchange_rate == SKIP unless credit_limit_exchange_rate == SKIP @credit_limit_exchange_rate = credit_limit_exchange_rate end end |
Instance Attribute Details
#credit_limit_exchange_rate ⇒ Float
Factor to be used for converting the amounts in credit limit currency to finance widget currency. (If finance currency is same as credit limit currency, then the value of this field will be “1” so that the value does not change)
33 34 35 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 33 def credit_limit_exchange_rate @credit_limit_exchange_rate end |
#currency_code ⇒ String
Currency ISO Code used for the Finance Widget.
15 16 17 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 15 def currency_code @currency_code end |
#currency_symbol ⇒ String
Currency Symbol
19 20 21 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 19 def currency_symbol @currency_symbol end |
#invoice_exchange_rate ⇒ Float
Factor to be used for converting the amounts in invoice currency to finance widget currency. (If finance currency is same as invoice currency, then the value of this field will be “1” so that the value does not change)
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 26 def invoice_exchange_rate @invoice_exchange_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 78 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 invoice_exchange_rate = hash.key?('Invoice_ExchangeRate') ? hash['Invoice_ExchangeRate'] : SKIP credit_limit_exchange_rate = hash.key?('CreditLimit_ExchangeRate') ? hash['CreditLimit_ExchangeRate'] : SKIP # Create object from extracted values. FinanceCurrency.new(currency_code, currency_symbol, invoice_exchange_rate, credit_limit_exchange_rate) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['currency_code'] = 'CurrencyCode' @_hash['currency_symbol'] = 'CurrencySymbol' @_hash['invoice_exchange_rate'] = 'Invoice_ExchangeRate' @_hash['credit_limit_exchange_rate'] = 'CreditLimit_ExchangeRate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 59 60 61 62 63 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 56 def self.nullables %w[ currency_code currency_symbol invoice_exchange_rate credit_limit_exchange_rate ] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 |
# File 'lib/shell_data_reporting_ap_is/models/finance_currency.rb', line 46 def self.optionals %w[ currency_code currency_symbol invoice_exchange_rate credit_limit_exchange_rate ] end |