Class: FlexibleEnum::AbstractConfigurator
- Inherits:
-
Struct
- Object
- Struct
- FlexibleEnum::AbstractConfigurator
- Defined in:
- lib/flexible_enum/abstract_configurator.rb
Direct Known Subclasses
ConstantConfigurator, IdentityConfigurator, PotentialValuesConfigurator, QuestionMethodConfigurator, ScopeConfigurator, SetterMethodConfigurator
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
Returns the value of attribute attribute_name.
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#feature_module ⇒ Object
Returns the value of attribute feature_module.
-
#module_for_elements ⇒ Object
Returns the value of attribute module_for_elements.
Instance Method Summary collapse
Instance Attribute Details
#attribute_name ⇒ Object
Returns the value of attribute attribute_name
2 3 4 |
# File 'lib/flexible_enum/abstract_configurator.rb', line 2 def attribute_name @attribute_name end |
#elements ⇒ Object
Returns the value of attribute elements
2 3 4 |
# File 'lib/flexible_enum/abstract_configurator.rb', line 2 def elements @elements end |
#feature_module ⇒ Object
Returns the value of attribute feature_module
2 3 4 |
# File 'lib/flexible_enum/abstract_configurator.rb', line 2 def feature_module @feature_module end |
#module_for_elements ⇒ Object
Returns the value of attribute module_for_elements
2 3 4 |
# File 'lib/flexible_enum/abstract_configurator.rb', line 2 def module_for_elements @module_for_elements end |
Instance Method Details
#add_class_method(method_name, &block) ⇒ Object
3 4 5 |
# File 'lib/flexible_enum/abstract_configurator.rb', line 3 def add_class_method(method_name, &block) feature_module.const_get(:ClassMethods).send(:define_method, method_name, &block) end |
#add_instance_method(method_name, &block) ⇒ Object
7 8 9 |
# File 'lib/flexible_enum/abstract_configurator.rb', line 7 def add_instance_method(method_name, &block) feature_module.send(:define_method, method_name, &block) end |