Class: Stigg::Models::V1::Feature::Data::UnitTransformation

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stigg/models/v1/feature.rb

Overview

Defined Under Namespace

Modules: Round

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(divide:, feature_units:, feature_units_plural:, round:) ⇒ Object

Unit transformation to be applied to the reported usage

Parameters:

  • divide (Float)

    Divide usage by this number

  • feature_units (String, nil)

    Singular feature units after the transformation

  • feature_units_plural (String, nil)

    Plural feature units after the transformation

  • round (Symbol, Stigg::Models::V1::Feature::Data::UnitTransformation::Round)

    After division, either round the result up or down



# File 'lib/stigg/models/v1/feature.rb', line 225

Instance Attribute Details

#divideFloat

Divide usage by this number

Returns:

  • (Float)


205
# File 'lib/stigg/models/v1/feature.rb', line 205

required :divide, Float

#feature_unitsString?

Singular feature units after the transformation

Returns:

  • (String, nil)


211
# File 'lib/stigg/models/v1/feature.rb', line 211

required :feature_units, String, api_name: :featureUnits, nil?: true

#feature_units_pluralString?

Plural feature units after the transformation

Returns:

  • (String, nil)


217
# File 'lib/stigg/models/v1/feature.rb', line 217

required :feature_units_plural, String, api_name: :featureUnitsPlural, nil?: true

#roundSymbol, Stigg::Models::V1::Feature::Data::UnitTransformation::Round

After division, either round the result up or down



223
# File 'lib/stigg/models/v1/feature.rb', line 223

required :round, enum: -> { Stigg::V1::Feature::Data::UnitTransformation::Round }