Module: Plushie::Model::Extensions Private

Included in:
Animation::State, Route::State, Selection::State, State::Container, Undo::Entry, Undo::State
Defined in:
lib/plushie/model.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Methods mixed into Model classes.

Instance Method Summary collapse

Instance Method Details

#with(**changes) ⇒ Object

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)



29
30
31
# File 'lib/plushie/model.rb', line 29

def with(**changes)
  self.class.new(**to_h.merge(changes))
end