Class: RuGUI::PropertyChangedSupport::PropertyChangedBlock
- Defined in:
- lib/rugui/property_changed_support.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#observer ⇒ Object
Returns the value of attribute observer.
-
#options ⇒ Object
Returns the value of attribute options.
-
#property ⇒ Object
Returns the value of attribute property.
Instance Method Summary collapse
-
#call_property_changed_block_if_exists(observer, observable, property, new_value, old_value) ⇒ Object
Call the block configurated for the property changed if a block exists for the one.
-
#set_options(method_or_options) ⇒ Object
Set the options given the args.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
57 58 59 |
# File 'lib/rugui/property_changed_support.rb', line 57 def block @block end |
#observer ⇒ Object
Returns the value of attribute observer.
58 59 60 |
# File 'lib/rugui/property_changed_support.rb', line 58 def observer @observer end |
#options ⇒ Object
Returns the value of attribute options.
56 57 58 |
# File 'lib/rugui/property_changed_support.rb', line 56 def @options end |
#property ⇒ Object
Returns the value of attribute property.
55 56 57 |
# File 'lib/rugui/property_changed_support.rb', line 55 def property @property end |
Instance Method Details
#call_property_changed_block_if_exists(observer, observable, property, new_value, old_value) ⇒ Object
Call the block configurated for the property changed if a block exists for the one.
61 62 63 64 |
# File 'lib/rugui/property_changed_support.rb', line 61 def call_property_changed_block_if_exists(observer, observable, property, new_value, old_value) self.observer = observer call_property_changed_block(observable, new_value, old_value) if block_exists?(observable, property, new_value, old_value) end |
#set_options(method_or_options) ⇒ Object
Set the options given the args.
67 68 69 70 71 72 73 74 |
# File 'lib/rugui/property_changed_support.rb', line 67 def () case when String, Symbol self. = { :call => prepared() } when Hash self. = end end |