Class: ModernTreasury::Models::ForeignExchangeRate
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ModernTreasury::Models::ForeignExchangeRate
- Defined in:
- lib/modern_treasury/models/foreign_exchange_rate.rb,
sig/modern_treasury/models/foreign_exchange_rate.rbs
Instance Attribute Summary collapse
-
#base_amount ⇒ Integer
Amount in the lowest denomination of the
base_currencyto convert, often called the "sell" amount. -
#base_currency ⇒ Symbol, ModernTreasury::Models::Currency
Currency to convert, often called the "sell" currency.
-
#exponent ⇒ Integer
The exponent component of the rate.
-
#rate_string ⇒ String
A string representation of the rate.
-
#target_amount ⇒ Integer
Amount in the lowest denomination of the
target_currency, often called the "buy" amount. -
#target_currency ⇒ Symbol, ModernTreasury::Models::Currency
Currency to convert the
base_currencyto, often called the "buy" currency. -
#value ⇒ Integer
The whole number component of the rate.
Instance Method Summary collapse
-
#initialize(base_amount:, base_currency:, exponent:, rate_string:, target_amount:, target_currency:, value:) ⇒ Object
constructor
Some parameter documentations has been truncated, see ForeignExchangeRate for more details.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(base_amount:, base_currency:, exponent:, rate_string:, target_amount:, target_currency:, value:) ⇒ Object
Some parameter documentations has been truncated, see ModernTreasury::Models::ForeignExchangeRate for more details.
|
|
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 52
|
Instance Attribute Details
#base_amount ⇒ Integer
Amount in the lowest denomination of the base_currency to convert, often
called the "sell" amount.
11 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 11 required :base_amount, Integer |
#base_currency ⇒ Symbol, ModernTreasury::Models::Currency
Currency to convert, often called the "sell" currency.
17 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 17 required :base_currency, enum: -> { ModernTreasury::Currency } |
#exponent ⇒ Integer
The exponent component of the rate. The decimal is calculated as value / (10 ^
exponent).
24 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 24 required :exponent, Integer |
#rate_string ⇒ String
A string representation of the rate.
30 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 30 required :rate_string, String |
#target_amount ⇒ Integer
Amount in the lowest denomination of the target_currency, often called the
"buy" amount.
37 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 37 required :target_amount, Integer |
#target_currency ⇒ Symbol, ModernTreasury::Models::Currency
Currency to convert the base_currency to, often called the "buy" currency.
43 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 43 required :target_currency, enum: -> { ModernTreasury::Currency } |
#value ⇒ Integer
The whole number component of the rate. The decimal is calculated as value /
(10 ^ exponent).
50 |
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 50 required :value, Integer |
Instance Method Details
#to_hash ⇒ {
39 |
# File 'sig/modern_treasury/models/foreign_exchange_rate.rbs', line 39
def to_hash: -> {
|