Class: Omnichannel::Err

Inherits:
Object
  • Object
show all
Defined in:
lib/omnichannel/models/err.rb

Constant Summary collapse

N0 =
0.freeze
N1 =
1.freeze
N2 =
2.freeze
N3 =
3.freeze
N4 =
4.freeze
N5 =
5.freeze
N6 =
6.freeze
N7 =
7.freeze
N8 =
8.freeze
N9 =
9.freeze
N10 =
10.freeze
N999 =
999.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



34
35
36
# File 'lib/omnichannel/models/err.rb', line 34

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



41
42
43
44
45
# File 'lib/omnichannel/models/err.rb', line 41

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