Class: Plushie::Undo::State

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

Overview

Immutable undo state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeState

Returns a new instance of State.

Parameters:

  • current: (Object)
  • max_size: (Integer)
  • undo_size: (Integer)
  • undo_stack: (Array[Entry])
  • redo_stack: (Array[Entry])


12
# File 'sig/plushie/undo.rbs', line 12

def initialize: (current: untyped, max_size: Integer, undo_size: Integer, undo_stack: Array[Entry], redo_stack: Array[Entry]) -> void

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

#withState

Parameters:

  • changes (Object)

Returns:



14
# File 'sig/plushie/undo.rbs', line 14

def with: (**untyped changes) -> State