Class: Plushie::Undo::State

Inherits:
Data
  • Object
show all
Includes:
Model::Extensions
Defined in:
lib/plushie/undo.rb

Overview

Immutable undo state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current

Returns:

  • (Object)

    the current value of current



37
38
39
# File 'lib/plushie/undo.rb', line 37

def current
  @current
end

#max_sizeObject (readonly)

Returns the value of attribute max_size

Returns:

  • (Object)

    the current value of max_size



37
38
39
# File 'lib/plushie/undo.rb', line 37

def max_size
  @max_size
end

#redo_stackObject (readonly)

Returns the value of attribute redo_stack

Returns:

  • (Object)

    the current value of redo_stack



37
38
39
# File 'lib/plushie/undo.rb', line 37

def redo_stack
  @redo_stack
end

#undo_sizeObject (readonly)

Returns the value of attribute undo_size

Returns:

  • (Object)

    the current value of undo_size



37
38
39
# File 'lib/plushie/undo.rb', line 37

def undo_size
  @undo_size
end

#undo_stackObject (readonly)

Returns the value of attribute undo_stack

Returns:

  • (Object)

    the current value of 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)