Class: QML::Reactive::Property

Inherits:
SimpleProperty show all
Includes:
Bindable
Defined in:
lib/qml/reactive/property.rb

Instance Attribute Summary

Attributes inherited from SimpleProperty

#changed, #value

Instance Method Summary collapse

Methods included from Bindable

#bind, #unbind, #value, #value=

Constructor Details

#initialize(initial_value = nil) { ... } ⇒ Property

Returns a new instance of Property.

Parameters:

  • initial_value (defaults to: nil)

    the initial value.

Yields:

  • the initial property binding (optional).



12
13
14
15
16
# File 'lib/qml/reactive/property.rb', line 12

def initialize(initial_value = nil, &block)
  super()
  self.value = initial_value if initial_value
  bind(&block) if block
end