Class: FlexibleEnum::PotentialValuesConfigurator::Option

Inherits:
Struct
  • Object
show all
Defined in:
lib/flexible_enum/potential_values_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



27
28
29
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27

def attribute_name
  @attribute_name
end

#element_configObject

Returns the value of attribute element_config

Returns:

  • (Object)

    the current value of element_config



27
28
29
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27

def element_config
  @element_config
end

#element_nameObject

Returns the value of attribute element_name

Returns:

  • (Object)

    the current value of element_name



27
28
29
# File 'lib/flexible_enum/potential_values_configurator.rb', line 27

def element_name
  @element_name
end

#target_classObject

Returns the value of attribute target_class

Returns:

  • (Object)

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



32
33
34
# File 'lib/flexible_enum/potential_values_configurator.rb', line 32

def human_name
  target_class.send("human_#{attribute_name}", value)
end

#nameObject



28
29
30
# File 'lib/flexible_enum/potential_values_configurator.rb', line 28

def name
  element_name.to_s
end

#valueObject



36
37
38
# File 'lib/flexible_enum/potential_values_configurator.rb', line 36

def value
  element_config[:value]
end