Module: RPCMapper::Persistence::InstanceMethods
- Defined in:
- lib/rpc_mapper/persistence.rb
Instance Method Summary collapse
- #[]=(attribute, value) ⇒ Object
- #attributes=(attributes) ⇒ Object
- #destroy ⇒ Object (also: #delete)
- #save ⇒ Object
- #save! ⇒ Object
- #update_attributes(attributes) ⇒ Object
- #update_attributes!(attributes) ⇒ Object
Instance Method Details
#[]=(attribute, value) ⇒ Object
18 19 20 |
# File 'lib/rpc_mapper/persistence.rb', line 18 def []=(attribute, value) set_attribute(attribute, value) end |
#attributes=(attributes) ⇒ Object
22 23 24 |
# File 'lib/rpc_mapper/persistence.rb', line 22 def attributes=(attributes) set_attributes(attributes) end |
#destroy ⇒ Object Also known as: delete
43 44 45 |
# File 'lib/rpc_mapper/persistence.rb', line 43 def destroy write_adapter.delete(self) unless self.new_record? end |
#save ⇒ Object
26 27 28 |
# File 'lib/rpc_mapper/persistence.rb', line 26 def save write_adapter.write(self) end |
#save! ⇒ Object
30 31 32 |
# File 'lib/rpc_mapper/persistence.rb', line 30 def save! save or raise RPCMapper::RecordNotSaved end |
#update_attributes(attributes) ⇒ Object
34 35 36 37 |
# File 'lib/rpc_mapper/persistence.rb', line 34 def update_attributes(attributes) self.attributes = attributes save end |
#update_attributes!(attributes) ⇒ Object
39 40 41 |
# File 'lib/rpc_mapper/persistence.rb', line 39 def update_attributes!(attributes) update_attributes(attributes) or raise RPCMapper::RecordNotSaved end |