Class: AftershipAPI::Model::AdditionalFields

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

Constant Summary collapse

TRACKING_ACCOUNT_NUMBER =
"tracking_account_number".freeze
DESTINATION_POSTAL_CODE =
"destination_postal_code".freeze
DESTINATION_STATE =
"destination_state".freeze
TRACKING_KEY =
"tracking_key".freeze
ORIGIN_COUNTRY_REGION =
"origin_country_region".freeze
DESTINATION_COUNTRY_REGION =
"destination_country_region".freeze
TRACKING_SHIP_DATE =
"tracking_ship_date".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



12
13
14
# File 'lib/aftership-tracking-sdk/models/additional_fields.rb', line 12

def self.all_vars
  @all_vars ||= [TRACKING_ACCOUNT_NUMBER, DESTINATION_POSTAL_CODE, DESTINATION_STATE, TRACKING_KEY, ORIGIN_COUNTRY_REGION, DESTINATION_COUNTRY_REGION, TRACKING_SHIP_DATE,].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



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

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



26
27
28
29
# File 'lib/aftership-tracking-sdk/models/additional_fields.rb', line 26

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