Class: AmznSpApi::ProductPricingApiModel::Condition

Inherits:
Object
  • Object
show all
Defined in:
lib/product_pricing_api_model/models/condition.rb

Constant Summary collapse

NEW =
'New'.freeze
USED =
'Used'.freeze
COLLECTIBLE =
'Collectible'.freeze
REFURBISHED =
'Refurbished'.freeze
CLUB =
'Club'.freeze

Instance Method Summary collapse

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string



23
24
25
26
27
28
# File 'lib/product_pricing_api_model/models/condition.rb', line 23

def build_from_hash(value)
  constantValues = Condition.constants.select { |c| Condition.const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #Condition" if constantValues.empty?

  value
end