Module: DataMapper::Is::ReadOnly::InstanceMethods

Defined in:
lib/dm-is-read_only/is/read_only.rb

Instance Method Summary collapse

Instance Method Details

#persistence_stateDataMapper::Is::ReadOnly::State

Overrides the default persistence_state method, to always use State.

Returns:

Since:

  • 0.3.0



79
80
81
# File 'lib/dm-is-read_only/is/read_only.rb', line 79

def persistence_state
  @_persistence_state ||= DataMapper::Is::ReadOnly::State.new(self)
end

#persistence_state=(new_state) ⇒ DataMapper::Is::ReadOnly::State

Prevents the persistence state from forcibly being changed.

Parameters:

  • new_state (DataMapper::Resource::State)

    The new state to use.

Returns:

Since:

  • 0.3.0



94
95
96
# File 'lib/dm-is-read_only/is/read_only.rb', line 94

def persistence_state=(new_state)
  persistence_state
end