Class: TestKaferiCloud::FontStyles

Inherits:
Object
  • Object
show all
Defined in:
lib/test_kaferi_cloud/models/font_styles.rb

Constant Summary collapse

REGULAR =
0.freeze
BOLD =
1.freeze
ITALIC =
2.freeze

Instance Method Summary collapse

Instance Method Details

#build_from_hash(value) ⇒ Fixnum

Builds the enum from string

Parameters:

  • The (Fixnum)

    enum value in the form of the string

Returns:

  • (Fixnum)

    The enum value



34
35
36
37
38
39
# File 'lib/test_kaferi_cloud/models/font_styles.rb', line 34

def build_from_hash(value)
  constantValues = FontStyles.constants.select{ |const_name| FontStyles.const_get(const_name) == value}
  raise "Invalid ENUM value #{value} for class #FontStyles" if constantValues.empty?
  value
  #constantValues[0]
end