Class: AftershipAPI::Model::TagV1

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

Constant Summary collapse

PENDING =
"Pending".freeze
INFORECEIVED =
"InfoReceived".freeze
INTRANSIT =
"InTransit".freeze
OUTFORDELIVERY =
"OutForDelivery".freeze
ATTEMPTFAIL =
"AttemptFail".freeze
DELIVERED =
"Delivered".freeze
AVAILABLEFORPICKUP =
"AvailableForPickup".freeze
EXCEPTION =
"Exception".freeze
EXPIRED =
"Expired".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



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

def self.all_vars
  @all_vars ||= [PENDING,INFORECEIVED,INTRANSIT,OUTFORDELIVERY,ATTEMPTFAIL,DELIVERED,AVAILABLEFORPICKUP,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



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

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



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

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