Class: Wee::ValueHolder
Overview
Implements a value holder. Useful for backtracking the reference assigned to an instance variable (not the object itself!). An example where this is used is the @__decoration attribute of class Wee::Component.
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value = nil) ⇒ ValueHolder
constructor
A new instance of ValueHolder.
- #restore_snapshot(value) ⇒ Object
- #take_snapshot ⇒ Object
Constructor Details
#initialize(value = nil) ⇒ ValueHolder
Returns a new instance of ValueHolder.
8 9 10 |
# File 'lib/wee/core/valueholder.rb', line 8 def initialize(value=nil) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/wee/core/valueholder.rb', line 6 def value @value end |