Class: AsposePdfCloud::FontStyles

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

Constant Summary collapse

REGULAR =
"Regular".freeze
BOLD =
"Bold".freeze
ITALIC =
"Italic".freeze
BOLD_ITALIC =
"BoldItalic".freeze

Instance Method Summary collapse

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



36
37
38
39
40
41
42
43
# File 'lib/aspose_pdf_cloud/models/font_styles.rb', line 36

def build_from_hash(value)
  # resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
  # consantValues = FontStyles.constants.select{|c| c.to_s == 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
end