Class: UnitOpenapiRubySdk::AnnualIncome

Inherits:
Object
  • Object
show all
Defined in:
lib/unit_openapi_ruby_sdk/models/annual_income.rb

Constant Summary collapse

UP_TO10K =
"UpTo10k".freeze
BETWEEN10K_AND25K =
"Between10kAnd25k".freeze
BETWEEN25K_AND50K =
"Between25kAnd50k".freeze
BETWEEN50K_AND100K =
"Between50kAnd100k".freeze
BETWEEN100K_AND250K =
"Between100kAnd250k".freeze
OVER250K =
"Over250k".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



25
26
27
# File 'lib/unit_openapi_ruby_sdk/models/annual_income.rb', line 25

def self.all_vars
  @all_vars ||= [UP_TO10K, BETWEEN10K_AND25K, BETWEEN25K_AND50K, BETWEEN50K_AND100K, BETWEEN100K_AND250K, OVER250K].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



32
33
34
# File 'lib/unit_openapi_ruby_sdk/models/annual_income.rb', line 32

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



39
40
41
42
# File 'lib/unit_openapi_ruby_sdk/models/annual_income.rb', line 39

def build_from_hash(value)
  return value if AnnualIncome.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #AnnualIncome"
end