Class: EacRubyUtils::Listable::Value
- Defined in:
- lib/eac_ruby_utils/listable/value.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #constant_name ⇒ Object
- #description ⇒ Object
-
#initialize(list, value, key) ⇒ Value
constructor
A new instance of Value.
- #label ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(list, value, key) ⇒ Value
Returns a new instance of Value.
10 11 12 13 14 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 10 def initialize(list, value, key) @list = list @value = value @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 8 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 8 def value @value end |
Instance Method Details
#constant_name ⇒ Object
20 21 22 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 20 def constant_name ::EacRubyUtils::Inflector.variableize("#{@list.item}_#{@key}").upcase end |
#description ⇒ Object
28 29 30 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 28 def description translate('description') end |
#label ⇒ Object
24 25 26 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 24 def label translate('label') end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/eac_ruby_utils/listable/value.rb', line 16 def to_s "I: #{@list.item}, V: #{@value}, K: #{@key}" end |