Class: QML::Reactive::UnboundProperty
- Inherits:
-
Object
- Object
- QML::Reactive::UnboundProperty
- Defined in:
- lib/qml/reactive/unbound_property.rb
Instance Attribute Summary collapse
-
#initial_binding ⇒ Object
readonly
Returns the value of attribute initial_binding.
-
#initial_value ⇒ Object
readonly
Returns the value of attribute initial_value.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#notifier_signal ⇒ Object
readonly
Returns the value of attribute notifier_signal.
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Instance Method Summary collapse
- #alias(name) ⇒ Object
- #alias? ⇒ Boolean
- #bind(obj) ⇒ Object
-
#initialize(name, initial_value, initial_binding, owner, factory = nil) ⇒ UnboundProperty
constructor
A new instance of UnboundProperty.
Constructor Details
#initialize(name, initial_value, initial_binding, owner, factory = nil) ⇒ UnboundProperty
Returns a new instance of UnboundProperty.
9 10 11 12 13 14 15 16 17 |
# File 'lib/qml/reactive/unbound_property.rb', line 9 def initialize(name, initial_value, initial_binding, owner, factory = nil) @name = name @initial_value = initial_value @initial_binding = initial_binding @owner = owner @notifier_signal = UnboundSignal.new(:"#{name}_changed", [:new_value], false, owner) @factory = factory @original = name end |
Instance Attribute Details
#initial_binding ⇒ Object (readonly)
Returns the value of attribute initial_binding.
7 8 9 |
# File 'lib/qml/reactive/unbound_property.rb', line 7 def initial_binding @initial_binding end |
#initial_value ⇒ Object (readonly)
Returns the value of attribute initial_value.
7 8 9 |
# File 'lib/qml/reactive/unbound_property.rb', line 7 def initial_value @initial_value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/qml/reactive/unbound_property.rb', line 7 def name @name end |
#notifier_signal ⇒ Object (readonly)
Returns the value of attribute notifier_signal.
7 8 9 |
# File 'lib/qml/reactive/unbound_property.rb', line 7 def notifier_signal @notifier_signal end |
#original ⇒ Object (readonly)
Returns the value of attribute original.
7 8 9 |
# File 'lib/qml/reactive/unbound_property.rb', line 7 def original @original end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
7 8 9 |
# File 'lib/qml/reactive/unbound_property.rb', line 7 def owner @owner end |
Instance Method Details
#alias(name) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/qml/reactive/unbound_property.rb', line 19 def alias(name) notifier_signal_orig = @notifier_signal dup.tap do |property| property.instance_eval do @name = name @notifier_signal = notifier_signal_orig.alias(:"#{name}_changed") end end end |
#alias? ⇒ Boolean
29 30 31 |
# File 'lib/qml/reactive/unbound_property.rb', line 29 def alias? @original != @name end |