Class: LegacyEnum::MethodDefinitionDSL
- Inherits:
-
Object
- Object
- LegacyEnum::MethodDefinitionDSL
- Defined in:
- lib/legacy_enum/method_definition_dsl.rb
Instance Attribute Summary collapse
-
#enum_def ⇒ Object
Returns the value of attribute enum_def.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/legacy_enum/method_definition_dsl.rb', line 5 def method_missing(symbol, *args) @enum_def ||= [] @enum_def.singleton_class.send :include, ConfigurationSearch = args. .merge! name: symbol .merge! value: args[0] unless args.empty? .merge! label: symbol.to_s.titleize unless .keys.include?(:label) @enum_def << end |
Instance Attribute Details
#enum_def ⇒ Object
Returns the value of attribute enum_def.
3 4 5 |
# File 'lib/legacy_enum/method_definition_dsl.rb', line 3 def enum_def @enum_def end |