Class: VER::Undo::AutoSeparator
Overview
Tree
Constant Summary
Constants inherited from Struct
Instance Attribute Summary collapse
-
#records ⇒ Object
Returns the value of attribute records.
-
#tree ⇒ Object
Returns the value of attribute tree.
Instance Method Summary collapse
- #delete(*args) ⇒ Object
-
#initialize(tree) {|_self| ... } ⇒ AutoSeparator
constructor
A new instance of AutoSeparator.
- #insert(*args) ⇒ Object
- #replace(*args) ⇒ Object
Methods inherited from Struct
Constructor Details
#initialize(tree) {|_self| ... } ⇒ AutoSeparator
Returns a new instance of AutoSeparator.
106 107 108 109 110 111 112 113 |
# File 'lib/ver/undo.rb', line 106 def initialize(tree) self.tree = tree self.records = [] yield(self) if block_given? records.last.separator = true if records.any? end |
Instance Attribute Details
#records ⇒ Object
Returns the value of attribute records
105 106 107 |
# File 'lib/ver/undo.rb', line 105 def records @records end |
#tree ⇒ Object
Returns the value of attribute tree
105 106 107 |
# File 'lib/ver/undo.rb', line 105 def tree @tree end |
Instance Method Details
#delete(*args) ⇒ Object
129 130 131 132 133 134 |
# File 'lib/ver/undo.rb', line 129 def delete(*args) tree.record do |record| record.delete(*args) records << record end end |
#insert(*args) ⇒ Object
115 116 117 118 119 120 |
# File 'lib/ver/undo.rb', line 115 def insert(*args) tree.record do |record| record.insert(*args) records << record end end |
#replace(*args) ⇒ Object
122 123 124 125 126 127 |
# File 'lib/ver/undo.rb', line 122 def replace(*args) tree.record do |record| record.replace(*args) records << record end end |