Class: Anthropic::Models::BetaMonetaryAmount

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta_monetary_amount.rb,
sig/anthropic/models/beta_monetary_amount.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:) ⇒ Object

Some parameter documentations has been truncated, see Anthropic::Models::BetaMonetaryAmount for more details.

A monetary amount in a specific currency.

Parameters:

  • amount (String)

    Amount in minor units of the currency, as an integer decimal string with no lead

  • currency (Symbol, Anthropic::Models::BetaCurrency)

    Uppercase ISO-4217 currency code. USD is the only currency currently supported



# File 'lib/anthropic/models/beta_monetary_amount.rb', line 22

Instance Attribute Details

#amountString

Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/anthropic/models/beta_monetary_amount.rb', line 12

required :amount, String

#currencySymbol, Anthropic::Models::BetaCurrency

Uppercase ISO-4217 currency code. USD is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

Parameters:

  • value (Anthropic::Models::beta_currency)

Returns:



20
# File 'lib/anthropic/models/beta_monetary_amount.rb', line 20

required :currency, enum: -> { Anthropic::BetaCurrency }

Instance Method Details

#to_hash{

Returns:

  • ({)


16
# File 'sig/anthropic/models/beta_monetary_amount.rbs', line 16

def to_hash: -> {