Class: AftershipAPI::Model::Tag

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

Constant Summary collapse

PENDING =
"Pending".freeze
INFO_RECEIVED =
"InfoReceived".freeze
IN_TRANSIT =
"InTransit".freeze
OUT_FOR_DELIVERY =
"OutForDelivery".freeze
ATTEMPT_FAIL =
"AttemptFail".freeze
DELIVERED =
"Delivered".freeze
AVAILABLE_FOR_PICKUP =
"AvailableForPickup".freeze
EXCEPTION =
"Exception".freeze
EXPIRED =
"Expired".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



14
15
16
# File 'lib/aftership-tracking-sdk/models/tag.rb', line 14

def self.all_vars
  @all_vars ||= [PENDING, INFO_RECEIVED, IN_TRANSIT, OUT_FOR_DELIVERY, ATTEMPT_FAIL, DELIVERED, AVAILABLE_FOR_PICKUP, EXCEPTION, EXPIRED,].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



21
22
23
# File 'lib/aftership-tracking-sdk/models/tag.rb', line 21

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



28
29
30
31
# File 'lib/aftership-tracking-sdk/models/tag.rb', line 28

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