Class: ConfValue

Inherits:
Object
  • Object
show all
Includes:
Translating
Defined in:
lib/gui/conf_value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Translating

language, trl, #trl

Constructor Details

#initialize(label, value) ⇒ ConfValue

Returns a new instance of ConfValue.



38
39
40
41
42
43
44
45
46
47
# File 'lib/gui/conf_value.rb', line 38

def initialize(label, value)
  @label = label
  @value = value
  @value ||= ''
  if(value.respond_to?(:to_ary) )
    @display_value = @value.map{|v| trl(v) }
  else
    @display_value = trl(value.to_s, false)
  end
end

Instance Attribute Details

#display_valueObject (readonly)

Returns the value of attribute display_value.



53
54
55
# File 'lib/gui/conf_value.rb', line 53

def display_value
  @display_value
end

#valueObject

Returns the value of attribute value.



52
53
54
# File 'lib/gui/conf_value.rb', line 52

def value
  @value
end

Instance Method Details

#to_sObject



48
49
50
# File 'lib/gui/conf_value.rb', line 48

def to_s
  self.class.name.dup << ': value = ' << @value.to_s << ', display_value = ' << @display_value.to_s
end