Class: FactPulse::TypeFacture

Inherits:
Object
  • Object
show all
Defined in:
lib/factpulse/models/type_facture.rb

Constant Summary collapse

N380 =
"380".freeze
N389 =
"389".freeze
N393 =
"393".freeze
N501 =
"501".freeze
N386 =
"386".freeze
N500 =
"500".freeze
N384 =
"384".freeze
N471 =
"471".freeze
N472 =
"472".freeze
N473 =
"473".freeze
N381 =
"381".freeze
N261 =
"261".freeze
N262 =
"262".freeze
N396 =
"396".freeze
N502 =
"502".freeze
N503 =
"503".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



35
36
37
# File 'lib/factpulse/models/type_facture.rb', line 35

def self.all_vars
  @all_vars ||= [N380, N389, N393, N501, N386, N500, N384, N471, N472, N473, N381, N261, N262, N396, N502, N503].freeze
end

.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



42
43
44
# File 'lib/factpulse/models/type_facture.rb', line 42

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



49
50
51
52
# File 'lib/factpulse/models/type_facture.rb', line 49

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