Class: Yapstone::GovernmentIdType

Inherits:
Object
  • Object
show all
Defined in:
lib/yapstone-so/models/government_id_type.rb

Constant Summary collapse

DRIVERS_LICENSE =
"DRIVERS_LICENSE".freeze
PASSPORT =
"PASSPORT".freeze
GOVERNMENT_ID =
"GOVERNMENT_ID".freeze
PASSPORT_CARD =
"PASSPORT_CARD".freeze
LAST_FOUR_SSN =
"LAST_FOUR_SSN".freeze
TAX_ID =
"TAX_ID".freeze
SIN =
"SIN".freeze
NIF =
"NIF".freeze
CODICE_FISCALE =
"CODICE_FISCALE".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



30
31
32
# File 'lib/yapstone-so/models/government_id_type.rb', line 30

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:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



37
38
39
40
41
# File 'lib/yapstone-so/models/government_id_type.rb', line 37

def build_from_hash(value)
  constantValues = GovernmentIdType.constants.select { |c| GovernmentIdType::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #GovernmentIdType" if constantValues.empty?
  value
end