Module: TkComponent::Builder::ValueTyping

Included in:
TkItemWithVariable, TkText
Defined in:
lib/tk_component/builder/tk_item.rb

Instance Method Summary collapse

Instance Method Details

#apply_option(option, v, to_item = self.native_item) ⇒ Object



77
78
79
80
81
82
83
84
# File 'lib/tk_component/builder/tk_item.rb', line 77

def apply_option(option, v, to_item = self.native_item)
  case option.to_sym
  when :value
    self.value = v
  else
    super
  end
end

#f_valueObject



94
95
96
# File 'lib/tk_component/builder/tk_item.rb', line 94

def f_value
  value.to_f
end

#i_valueObject



90
91
92
# File 'lib/tk_component/builder/tk_item.rb', line 90

def i_value
  value.to_i
end

#s_valueObject



98
99
100
# File 'lib/tk_component/builder/tk_item.rb', line 98

def s_value
  value.to_s
end

#update_value(v) ⇒ Object



86
87
88
# File 'lib/tk_component/builder/tk_item.rb', line 86

def update_value(v)
  self.value = v if value.to_s != v.to_s
end