Class: Plushie::State::Container

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

Overview

Immutable state container.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



25
26
27
# File 'lib/plushie/state.rb', line 25

def data
  @data
end

#revisionObject (readonly)

Returns the value of attribute revision

Returns:

  • (Object)

    the current value of revision



25
26
27
# File 'lib/plushie/state.rb', line 25

def revision
  @revision
end

#transactionObject (readonly)

Returns the value of attribute transaction

Returns:

  • (Object)

    the current value of transaction



25
26
27
# File 'lib/plushie/state.rb', line 25

def transaction
  @transaction
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)