Class: Plushie::Undo::State
- Inherits:
-
Data
- Object
- Data
- Plushie::Undo::State
- Includes:
- Model::Extensions
- Defined in:
- lib/plushie/undo.rb
Overview
Immutable undo state.
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#max_size ⇒ Object
readonly
Returns the value of attribute max_size.
-
#redo_stack ⇒ Object
readonly
Returns the value of attribute redo_stack.
-
#undo_size ⇒ Object
readonly
Returns the value of attribute undo_size.
-
#undo_stack ⇒ Object
readonly
Returns the value of attribute undo_stack.
Instance Method Summary collapse
-
#with(**changes) ⇒ Object
included
from Model::Extensions
private
Return a new instance with the given fields replaced.
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current
37 38 39 |
# File 'lib/plushie/undo.rb', line 37 def current @current end |
#max_size ⇒ Object (readonly)
Returns the value of attribute max_size
37 38 39 |
# File 'lib/plushie/undo.rb', line 37 def max_size @max_size end |
#redo_stack ⇒ Object (readonly)
Returns the value of attribute redo_stack
37 38 39 |
# File 'lib/plushie/undo.rb', line 37 def redo_stack @redo_stack end |
#undo_size ⇒ Object (readonly)
Returns the value of attribute undo_size
37 38 39 |
# File 'lib/plushie/undo.rb', line 37 def undo_size @undo_size end |
#undo_stack ⇒ Object (readonly)
Returns the value of attribute undo_stack
37 38 39 |
# File 'lib/plushie/undo.rb', line 37 def undo_stack @undo_stack end |
Instance Method Details
#with(**changes) ⇒ Object Originally defined in module Model::Extensions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return a new instance with the given fields replaced. Unspecified fields carry over from the current instance.
model.with(count: model.count + 1)