Class: MetronomeSDK::Models::V1::Contracts::QuantityRounding

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb,
sig/metronome_sdk/models/v1/contracts/quantity_rounding.rbs

Defined Under Namespace

Modules: RoundingMethod

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(decimal_places:, rounding_method:) ⇒ Object

Optional. Only valid for USAGE products. If provided, the quantity will be rounded using the provided rounding method and decimal places. For example, if the method is "round up" and the decimal places is 0, then the quantity will be rounded up to the nearest integer.

Parameters:



# File 'lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb', line 18

Instance Attribute Details

#decimal_placesFloat

Parameters:

  • value (Float)

Returns:

  • (Float)


11
# File 'lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb', line 11

required :decimal_places, Float

#rounding_methodSymbol, MetronomeSDK::Models::V1::Contracts::QuantityRounding::RoundingMethod

Parameters:

  • value (MetronomeSDK::Models::V1::Contracts::QuantityRounding::rounding_method)

Returns:



16
# File 'lib/metronome_sdk/models/v1/contracts/quantity_rounding.rb', line 16

required :rounding_method, enum: -> { MetronomeSDK::V1::Contracts::QuantityRounding::RoundingMethod }

Instance Method Details

#to_hash{

Returns:

  • ({)


21
# File 'sig/metronome_sdk/models/v1/contracts/quantity_rounding.rbs', line 21

def to_hash: -> {