Class: ShellCardManagementApIs::FinanceCurrency2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::FinanceCurrency2
- Defined in:
- lib/shell_card_management_ap_is/models/finance_currency2.rb
Overview
FinanceCurrency2 Model.
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) ⇒ FinanceCurrency2
constructor
A new instance of FinanceCurrency2.
Methods inherited from BaseModel
Constructor Details
#initialize(currency_code = SKIP, currency_symbol = SKIP, invoice_exchange_rate = SKIP, credit_limit_exchange_rate = SKIP) ⇒ FinanceCurrency2
Returns a new instance of FinanceCurrency2.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 64 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)
32 33 34 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 32 def credit_limit_exchange_rate @credit_limit_exchange_rate end |
#currency_code ⇒ String
Currency ISO Code used for the Finance Widget.
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 14 def currency_code @currency_code end |
#currency_symbol ⇒ String
Currency Symbol
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 18 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)
25 26 27 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 25 def invoice_exchange_rate @invoice_exchange_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 77 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. FinanceCurrency2.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.
35 36 37 38 39 40 41 42 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 35 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
55 56 57 58 59 60 61 62 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 55 def self.nullables %w[ currency_code currency_symbol invoice_exchange_rate credit_limit_exchange_rate ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 |
# File 'lib/shell_card_management_ap_is/models/finance_currency2.rb', line 45 def self.optionals %w[ currency_code currency_symbol invoice_exchange_rate credit_limit_exchange_rate ] end |