Class: Glimmer::DataBinding::Tk::WidgetBinding
- Inherits:
-
Object
- Object
- Glimmer::DataBinding::Tk::WidgetBinding
- Includes:
- Glimmer, Observable, Observer
- Defined in:
- lib/glimmer/data_binding/tk/widget_binding.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
- #call(value) ⇒ Object
- #evaluate_attribute ⇒ Object
-
#initialize(widget, attribute) ⇒ WidgetBinding
constructor
A new instance of WidgetBinding.
Constructor Details
#initialize(widget, attribute) ⇒ WidgetBinding
Returns a new instance of WidgetBinding.
34 35 36 37 |
# File 'lib/glimmer/data_binding/tk/widget_binding.rb', line 34 def initialize(, attribute) @widget = @attribute = attribute end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
33 34 35 |
# File 'lib/glimmer/data_binding/tk/widget_binding.rb', line 33 def attribute @attribute end |
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
33 34 35 |
# File 'lib/glimmer/data_binding/tk/widget_binding.rb', line 33 def @widget end |
Instance Method Details
#call(value) ⇒ Object
39 40 41 |
# File 'lib/glimmer/data_binding/tk/widget_binding.rb', line 39 def call(value) @widget.set_attribute(@attribute, value) unless evaluate_attribute == value end |
#evaluate_attribute ⇒ Object
43 44 45 |
# File 'lib/glimmer/data_binding/tk/widget_binding.rb', line 43 def evaluate_attribute @widget.get_attribute(@attribute) end |