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.
1642 1643 1644 1645 |
# File 'lib/textbringer/buffer.rb', line 1642 def initialize(buffer, location) super(buffer, location) @actions = [] end |
Instance Method Details
#add_action(action) ⇒ Object
1647 1648 1649 |
# File 'lib/textbringer/buffer.rb', line 1647 def add_action(action) @actions.push(action) end |
#redo ⇒ Object
1657 1658 1659 1660 1661 |
# File 'lib/textbringer/buffer.rb', line 1657 def redo @actions.each do |action| action.redo end end |
#undo ⇒ Object
1651 1652 1653 1654 1655 |
# File 'lib/textbringer/buffer.rb', line 1651 def undo @actions.reverse_each do |action| action.undo end end |