Class: AftershipAPI::Model::AdditionalFieldsV1

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

Constant Summary collapse

TRACKING_ACCOUNT_NUMBER =
"tracking_account_number".freeze
TRACKING_POSTAL_CODE =
"tracking_postal_code".freeze
TRACKING_SHIP_DATE =
"tracking_ship_date".freeze
TRACKING_KEY =
"tracking_key".freeze
TRACKING_ORIGIN_COUNTRY =
"tracking_origin_country".freeze
TRACKING_DESTINATION_COUNTRY =
"tracking_destination_country".freeze
TRACKING_STATE =
"tracking_state".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



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

def self.all_vars
  @all_vars ||= [TRACKING_ACCOUNT_NUMBER,TRACKING_POSTAL_CODE,TRACKING_SHIP_DATE,TRACKING_KEY,TRACKING_ORIGIN_COUNTRY,TRACKING_DESTINATION_COUNTRY,TRACKING_STATE,].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



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

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



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

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