Class: DataMapper::Resource::State::Clean
Overview
a persisted/unmodified resource
Instance Attribute Summary
#resource
Instance Method Summary
collapse
Methods inherited from Persisted
#get
#get, #initialize
Methods included from Equalizer
#equalize
Instance Method Details
#commit ⇒ Object
23
24
25
|
# File 'lib/dm-core/resource/state/clean.rb', line 23
def commit
self
end
|
#delete ⇒ Object
19
20
21
|
# File 'lib/dm-core/resource/state/clean.rb', line 19
def delete
Deleted.new(resource)
end
|
#rollback ⇒ Object
27
28
29
|
# File 'lib/dm-core/resource/state/clean.rb', line 27
def rollback
self
end
|
#set(subject, value) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/dm-core/resource/state/clean.rb', line 7
def set(subject, value)
if not_modified?(subject, value)
self
else
state = resource.persisted_state = Dirty.new(resource)
state.set(subject, value)
end
end
|