Class: Autodeps::ReactiveData
- Inherits:
-
Object
- Object
- Autodeps::ReactiveData
- Defined in:
- lib/autodeps/reactive_data.rb
Instance Attribute Summary collapse
-
#dep ⇒ Object
Returns the value of attribute dep.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #change_to(value) ⇒ Object
-
#initialize(value) ⇒ ReactiveData
constructor
A new instance of ReactiveData.
Constructor Details
#initialize(value) ⇒ ReactiveData
Returns a new instance of ReactiveData.
4 5 6 7 |
# File 'lib/autodeps/reactive_data.rb', line 4 def initialize(value) @value = value @dep = Autodeps::Dependency.new end |
Instance Attribute Details
#dep ⇒ Object
Returns the value of attribute dep.
3 4 5 |
# File 'lib/autodeps/reactive_data.rb', line 3 def dep @dep end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/autodeps/reactive_data.rb', line 3 def value @value end |
Instance Method Details
#change_to(value) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/autodeps/reactive_data.rb', line 8 def change_to(value) if value != @value changed = true end @value = value if changed @dep.changed end end |