Class: ROM::Session::State Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/session/state.rb,
lib/rom/session/state/created.rb,
lib/rom/session/state/deleted.rb,
lib/rom/session/state/updated.rb,
lib/rom/session/state/persisted.rb,
lib/rom/session/state/transient.rb

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

Defined Under Namespace

Classes: Created, Deleted, Persisted, Transient, Updated

Constant Summary collapse

TransitionError =

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

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#created?Boolean

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.

Returns:

  • (Boolean)


28
29
30
# File 'lib/rom/session/state.rb', line 28

def created?
  instance_of?(Created)
end

#deleteObject

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.

Raises:



18
19
20
# File 'lib/rom/session/state.rb', line 18

def delete(*)
  raise TransitionError, "cannot delete object with #{self.class} state"
end

#deleted?Boolean

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.

Returns:

  • (Boolean)


43
44
45
# File 'lib/rom/session/state.rb', line 43

def deleted?
  instance_of?(Deleted)
end

#persisted?Boolean

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.

Returns:

  • (Boolean)


33
34
35
# File 'lib/rom/session/state.rb', line 33

def persisted?
  instance_of?(Persisted)
end

#saveObject

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.

Raises:



13
14
15
# File 'lib/rom/session/state.rb', line 13

def save(*)
  raise TransitionError, "cannot save object with #{self.class} state"
end

#transient?Boolean

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.

Returns:

  • (Boolean)


23
24
25
# File 'lib/rom/session/state.rb', line 23

def transient?
  instance_of?(Transient)
end

#updated?Boolean

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.

Returns:

  • (Boolean)


38
39
40
# File 'lib/rom/session/state.rb', line 38

def updated?
  instance_of?(Updated)
end