Class: EacRubyUtils::Listable::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/listable/item.rb

Instance Method Summary collapse

Instance Method Details

#constant_nameObject



15
16
17
# File 'lib/eac_ruby_utils/listable/item.rb', line 15

def constant_name
  ::EacRubyUtils::Inflector.variableize("#{list.item}_#{key}").upcase
end

#descriptionObject



23
24
25
# File 'lib/eac_ruby_utils/listable/item.rb', line 23

def description
  translate('description')
end

#labelObject



19
20
21
# File 'lib/eac_ruby_utils/listable/item.rb', line 19

def label
  translate('label')
end

#to_optionArray

Returns A two-item array in format ‘[label, value]`.

Returns:

  • (Array)

    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_sObject



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

Returns:



32
33
34
# File 'lib/eac_ruby_utils/listable/item.rb', line 32

def translation_required?
  translation_required
end