Module: Ruco::Editor::History
- Included in:
- Ruco::EditorArea
- Defined in:
- lib/ruco/editor/history.rb
Instance Method Summary collapse
Instance Method Details
#initialize(content, options) ⇒ Object
4 5 6 7 |
# File 'lib/ruco/editor/history.rb', line 4 def initialize(content, ) super(content, ) @history = Ruco::History.new(([:history]||{}).reverse_merge(:state => state, :track => [:content], :entries => 100, :timeout => 2)) end |
#redo ⇒ Object
14 15 16 17 |
# File 'lib/ruco/editor/history.rb', line 14 def redo @history.redo self.state = @history.state end |
#undo ⇒ Object
9 10 11 12 |
# File 'lib/ruco/editor/history.rb', line 9 def undo @history.undo self.state = @history.state end |
#view ⇒ Object
19 20 21 22 |
# File 'lib/ruco/editor/history.rb', line 19 def view @history.add(state) super end |