Class: Plushie::Undo::Entry

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

Overview

Immutable undo entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEntry

Returns a new instance of Entry.

Parameters:

  • apply_fn: (^(untyped) -> untyped)
  • undo_fn: (^(untyped) -> untyped)
  • label: (String, nil)
  • coalesce: (Object)
  • timestamp: (Integer)


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

def initialize: (apply_fn: ^(untyped) -> untyped, undo_fn: ^(untyped) -> untyped, label: String?, coalesce: untyped, timestamp: Integer) -> void

Instance Attribute Details

#apply_fnObject (readonly)

Returns the value of attribute apply_fn

Returns:

  • (Object)

    the current value of apply_fn



42
43
44
# File 'lib/plushie/undo.rb', line 42

def apply_fn
  @apply_fn
end

#coalesceObject (readonly)

Returns the value of attribute coalesce

Returns:

  • (Object)

    the current value of coalesce



42
43
44
# File 'lib/plushie/undo.rb', line 42

def coalesce
  @coalesce
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



42
43
44
# File 'lib/plushie/undo.rb', line 42

def label
  @label
end

#timestampObject (readonly)

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



42
43
44
# File 'lib/plushie/undo.rb', line 42

def timestamp
  @timestamp
end

#undo_fnObject (readonly)

Returns the value of attribute undo_fn

Returns:

  • (Object)

    the current value of undo_fn



42
43
44
# File 'lib/plushie/undo.rb', line 42

def undo_fn
  @undo_fn
end

Instance Method Details

#withEntry

Parameters:

  • changes (Object)

Returns:



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

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