class EacRubyUtils::Listable::Value

Attributes

key[R]
value[R]

Public Class Methods

new(list, value, key) click to toggle source
# File lib/eac_ruby_utils/listable/value.rb, line 10
def initialize(list, value, key)
  @list = list
  @value = value
  @key = key
end

Public Instance Methods

constant_name() click to toggle source
# File lib/eac_ruby_utils/listable/value.rb, line 20
def constant_name
  ::EacRubyUtils::Inflector.variableize("#{@list.item}_#{@key}").upcase
end
description() click to toggle source
# File lib/eac_ruby_utils/listable/value.rb, line 28
def description
  translate('description')
end
label() click to toggle source
# File lib/eac_ruby_utils/listable/value.rb, line 24
def label
  translate('label')
end
to_s() click to toggle source
# File lib/eac_ruby_utils/listable/value.rb, line 16
def to_s
  "I: #{@list.item}, V: #{@value}, K: #{@key}"
end

Private Instance Methods

translate(translate_key) click to toggle source
# File lib/eac_ruby_utils/listable/value.rb, line 34
def translate(translate_key)
  ::I18n.t("#{@list.i18n_key}.#{@key}.#{translate_key}")
end