Class: FinchAPI::Models::Money

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/finch_api/models/money.rb,
sig/finch_api/models/money.rbs

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(amount:, currency:) ⇒ Money

Returns a new instance of Money.

Parameters:

  • amount (Integer, nil)

    Amount for money object (in cents)

  • currency (String)
  • amount: (Integer, nil)
  • currency: (String)


# File 'lib/finch_api/models/money.rb', line 17

Instance Attribute Details

#amountInteger?

Amount for money object (in cents)

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


10
# File 'lib/finch_api/models/money.rb', line 10

required :amount, Integer, nil?: true

#currencyString

Parameters:

  • value (String)

Returns:

  • (String)


15
# File 'lib/finch_api/models/money.rb', line 15

required :currency, String

Instance Method Details

#to_hash{ amount: Integer?, currency: String }

Returns:

  • ({ amount: Integer?, currency: String })


12
# File 'sig/finch_api/models/money.rbs', line 12

def to_hash: -> { amount: Integer?, currency: String }