Method: AsposePdfCloud::TextIcon#build_from_hash

Defined in:
lib/aspose_pdf_cloud/models/text_icon.rb

#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



43
44
45
46
47
48
49
50
# File 'lib/aspose_pdf_cloud/models/text_icon.rb', line 43

def build_from_hash(value)
  # resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
  # consantValues = TextIcon.constants.select{|c| c.to_s == value}
  constantValues = TextIcon.constants.select{ |const_name| TextIcon.const_get(const_name) == value}
  
  raise "Invalid ENUM value #{value} for class #TextIcon" if constantValues.empty?
  value
end