Class: EacRubyUtils::Listable::Item
- Defined in:
- lib/eac_ruby_utils/listable/item.rb
Instance Method Summary collapse
- #constant_name ⇒ Object
- #description ⇒ Object
- #label ⇒ Object
-
#to_option ⇒ Array
A two-item array in format ‘[label, value]`.
- #to_s ⇒ Object
- #translation_required? ⇒ Boolean
Instance Method Details
#constant_name ⇒ Object
15 16 17 |
# File 'lib/eac_ruby_utils/listable/item.rb', line 15 def constant_name ::EacRubyUtils::Inflector.variableize("#{list.item}_#{key}").upcase end |
#description ⇒ Object
23 24 25 |
# File 'lib/eac_ruby_utils/listable/item.rb', line 23 def description translate('description') end |
#label ⇒ Object
19 20 21 |
# File 'lib/eac_ruby_utils/listable/item.rb', line 19 def label translate('label') end |
#to_option ⇒ Array
Returns A two-item array in format ‘[label, value]`.
28 29 30 |
# File 'lib/eac_ruby_utils/listable/item.rb', line 28 def to_option [label, value] end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/eac_ruby_utils/listable/item.rb', line 11 def to_s "I: #{list.item}, V: #{value}, K: #{key}" end |
#translation_required? ⇒ Boolean
32 33 34 |
# File 'lib/eac_ruby_utils/listable/item.rb', line 32 def translation_required? translation_required end |