Class: TreeDelta
- Inherits:
-
Enumerator
- Object
- Enumerator
- TreeDelta
- Defined in:
- lib/tree_delta/base.rb
Defined Under Namespace
Modules: Normaliser, Sorter Classes: Intermediate, Operation, Traversal
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(from:, to:) ⇒ TreeDelta
constructor
A new instance of TreeDelta.
Constructor Details
#initialize(from:, to:) ⇒ TreeDelta
Returns a new instance of TreeDelta.
5 6 7 |
# File 'lib/tree_delta/base.rb', line 5 def initialize(from:, to:) @from, @to = from, to end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
3 4 5 |
# File 'lib/tree_delta/base.rb', line 3 def from @from end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
3 4 5 |
# File 'lib/tree_delta/base.rb', line 3 def to @to end |
Instance Method Details
#each(&block) ⇒ Object
9 10 11 12 13 |
# File 'lib/tree_delta/base.rb', line 9 def each(&block) deletes_and_detaches.each { |o| yield o } creates_and_attaches.each { |o| yield o } updates.each { |o| yield o } end |