Class: AmzSpApi::ShippingApiModel::ServiceType

Inherits:
Object
  • Object
show all
Defined in:
lib/shipping-api-model/models/service_type.rb

Constant Summary collapse

GROUND =
'Amazon Shipping Ground'.freeze
STANDARD =
'Amazon Shipping Standard'.freeze
PREMIUM =
'Amazon Shipping Premium'.freeze

Instance Method Summary collapse

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



23
24
25
26
27
# File 'lib/shipping-api-model/models/service_type.rb', line 23

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