Module: LegacyEnum::ConfigurationSearch
- Defined in:
- lib/legacy_enum/configuration_search.rb
Instance Method Summary collapse
Instance Method Details
#labelled(label) ⇒ Object
12 13 14 |
# File 'lib/legacy_enum/configuration_search.rb', line 12 def labelled(label) find { |config| config[:label] == label } || null_definition end |
#named(name) ⇒ Object
3 4 5 |
# File 'lib/legacy_enum/configuration_search.rb', line 3 def named(name) find { |config| config[:name] == name } || null_definition end |
#valued(value) ⇒ Object
7 8 9 10 |
# File 'lib/legacy_enum/configuration_search.rb', line 7 def valued(value) search_value = value.to_s.upcase find { |config| config[:value].to_s.upcase === search_value } || null_definition end |