Module: Believer::Persistence
Overview
Defines persistence functionality for a class
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes the Cassandra row.
-
#destroy ⇒ Object
Destroys the model.
- #persisted! ⇒ Object
- #persisted? ⇒ Boolean
-
#save ⇒ Object
Saves the model.
Instance Method Details
#delete ⇒ Object
Deletes the Cassandra row.
44 45 46 |
# File 'lib/believer/persistence.rb', line 44 def delete Delete.new(:record_class => self.class).where(key_values).execute end |
#destroy ⇒ Object
Destroys the model.
37 38 39 40 41 |
# File 'lib/believer/persistence.rb', line 37 def destroy res = self.delete @persisted = false res end |
#persisted! ⇒ Object
48 49 50 |
# File 'lib/believer/persistence.rb', line 48 def persisted! @persisted = true end |
#persisted? ⇒ Boolean
52 53 54 |
# File 'lib/believer/persistence.rb', line 52 def persisted? @persisted == true end |