Class: FlexibleEnum::AbstractConfigurator

Inherits:
Struct
  • Object
show all
Defined in:
lib/flexible_enum/abstract_configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attribute_nameObject

Returns the value of attribute attribute_name

Returns:

  • (Object)

    the current value of attribute_name



2
3
4
# File 'lib/flexible_enum/abstract_configurator.rb', line 2

def attribute_name
  @attribute_name
end

#elementsObject

Returns the value of attribute elements

Returns:

  • (Object)

    the current value of elements



2
3
4
# File 'lib/flexible_enum/abstract_configurator.rb', line 2

def elements
  @elements
end

#feature_moduleObject

Returns the value of attribute feature_module

Returns:

  • (Object)

    the current value of feature_module



2
3
4
# File 'lib/flexible_enum/abstract_configurator.rb', line 2

def feature_module
  @feature_module
end

#module_for_elementsObject

Returns the value of attribute module_for_elements

Returns:

  • (Object)

    the current value of 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