Class: AftershipAPI::Model::SlugGroupV1

Inherits:
Object
  • Object
show all
Defined in:
lib/aftership-tracking-sdk/models/slug_group_v1.rb

Constant Summary collapse

AMAZON_GROUP =
"amazon-group".freeze
FEDEX_GROUP =
"fedex-group".freeze
TOLL_GROUP =
"toll-group".freeze
TAQBIN_GROUP =
"taqbin-group".freeze
TNT_GROUP =
"tnt-group".freeze
CJ_GROUP =
"cj-group".freeze
HERMES_GROUP =
"hermes-group".freeze
DPD_GROUP =
"dpd-group".freeze
GLS_GROUP =
"gls-group".freeze
DHL_GROUP =
"dhl-group".freeze
FASTWAY_GROUP =
"fastway-group".freeze
ASENDIA_GROUP =
"asendia-group".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



18
19
20
# File 'lib/aftership-tracking-sdk/models/slug_group_v1.rb', line 18

def self.all_vars
  @all_vars ||= [AMAZON_GROUP,FEDEX_GROUP,TOLL_GROUP,TAQBIN_GROUP,TNT_GROUP,CJ_GROUP,HERMES_GROUP,DPD_GROUP,GLS_GROUP,DHL_GROUP,FASTWAY_GROUP,ASENDIA_GROUP,].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • value (String)

    The enum value in the form of the string

Returns:

  • (String)

    The enum value



25
26
27
# File 'lib/aftership-tracking-sdk/models/slug_group_v1.rb', line 25

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:

  • value (String)

    The enum value in the form of the string

Returns:

  • (String)

    The enum value



32
33
34
35
# File 'lib/aftership-tracking-sdk/models/slug_group_v1.rb', line 32

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