Class: ModernTreasury::Models::ForeignExchangeRate

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/foreign_exchange_rate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • base_amount (Integer) (defaults to: )

    Amount in the lowest denomination of the ‘base_currency` to convert, often calle

  • base_currency (Symbol, ModernTreasury::Models::Currency) (defaults to: )

    Currency to convert, often called the “sell” currency.

  • exponent (Integer) (defaults to: )

    The exponent component of the rate. The decimal is calculated as ‘value` / (10 ^

  • rate_string (String) (defaults to: )

    A string representation of the rate.

  • target_amount (Integer) (defaults to: )

    Amount in the lowest denomination of the ‘target_currency`, often called the “bu

  • target_currency (Symbol, ModernTreasury::Models::Currency) (defaults to: )

    Currency to convert the ‘base_currency` to, often called the “buy” currency.

  • value (Integer) (defaults to: )

    The whole number component of the rate. The decimal is calculated as ‘value` / (



# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 52


Instance Attribute Details

#base_amountInteger

Amount in the lowest denomination of the ‘base_currency` to convert, often called the “sell” amount.

Returns:

  • (Integer)


11
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 11

required :base_amount, Integer

#base_currencySymbol, 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 }

#exponentInteger

The exponent component of the rate. The decimal is calculated as ‘value` / (10 ^ `exponent`).

Returns:

  • (Integer)


24
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 24

required :exponent, Integer

#rate_stringString

A string representation of the rate.

Returns:

  • (String)


30
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 30

required :rate_string, String

#target_amountInteger

Amount in the lowest denomination of the ‘target_currency`, often called the “buy” amount.

Returns:

  • (Integer)


37
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 37

required :target_amount, Integer

#target_currencySymbol, 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 }

#valueInteger

The whole number component of the rate. The decimal is calculated as ‘value` / (10 ^ `exponent`).

Returns:

  • (Integer)


50
# File 'lib/modern_treasury/models/foreign_exchange_rate.rb', line 50

required :value, Integer