Class: Omml::Models::EnumString

Inherits:
Lutaml::Model::Type::String
  • Object
show all
Defined in:
lib/omml/models/simple_types/enum_string.rb

Class Method Summary collapse

Class Method Details

.cast(value, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/omml/models/simple_types/enum_string.rb', line 6

def self.cast(value, options = {})
  return if value.nil?

  values = defined_values
  return super unless values

  cast_options = options_with_values(options) do
    values.map do |entry|
      super(entry)
    end
  end

  super(value, cast_options)
end