Class: Textbringer::CompositeAction
- Inherits:
-
UndoableAction
- Object
- UndoableAction
- Textbringer::CompositeAction
- Defined in:
- lib/textbringer/buffer.rb
Instance Attribute Summary
Attributes inherited from UndoableAction
Instance Method Summary collapse
- #add_action(action) ⇒ Object
-
#initialize(buffer, location) ⇒ CompositeAction
constructor
A new instance of CompositeAction.
- #redo ⇒ Object
- #undo ⇒ Object
Constructor Details
#initialize(buffer, location) ⇒ CompositeAction
Returns a new instance of CompositeAction.
1592 1593 1594 1595 |
# File 'lib/textbringer/buffer.rb', line 1592 def initialize(buffer, location) super(buffer, location) @actions = [] end |
Instance Method Details
#add_action(action) ⇒ Object
1597 1598 1599 |
# File 'lib/textbringer/buffer.rb', line 1597 def add_action(action) @actions.push(action) end |
#redo ⇒ Object
1607 1608 1609 1610 1611 |
# File 'lib/textbringer/buffer.rb', line 1607 def redo @actions.each do |action| action.redo end end |
#undo ⇒ Object
1601 1602 1603 1604 1605 |
# File 'lib/textbringer/buffer.rb', line 1601 def undo @actions.reverse_each do |action| action.undo end end |