Class: FlexibleEnum::PotentialValuesConfigurator::Option
- Inherits:
-
Struct
- Object
- Struct
- FlexibleEnum::PotentialValuesConfigurator::Option
- Defined in:
- lib/flexible_enum/potential_values_configurator.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
Returns the value of attribute attribute_name.
-
#element_config ⇒ Object
Returns the value of attribute element_config.
-
#element_name ⇒ Object
Returns the value of attribute element_name.
-
#target_class ⇒ Object
Returns the value of attribute target_class.
Instance Method Summary collapse
Instance Attribute Details
#attribute_name ⇒ Object
Returns the value of attribute attribute_name
27 28 29 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27 def attribute_name @attribute_name end |
#element_config ⇒ Object
Returns the value of attribute element_config
27 28 29 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27 def element_config @element_config end |
#element_name ⇒ Object
Returns the value of attribute element_name
27 28 29 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27 def element_name @element_name end |
#target_class ⇒ Object
Returns the value of attribute target_class
27 28 29 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27 def target_class @target_class end |
Instance Method Details
#[](key) ⇒ Object
40 41 42 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 40 def [](key) element_config[key] end |
#human_name ⇒ Object
32 33 34 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 32 def human_name target_class.send("human_#{attribute_name}", value) end |
#name ⇒ Object
28 29 30 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 28 def name element_name.to_s end |
#value ⇒ Object
36 37 38 |
# File 'lib/flexible_enum/potential_values_configurator.rb', line 36 def value element_config[:value] end |