Module: HashBack::Resource::InstanceMethods
- Defined in:
- lib/hashback/resource.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Destroy the persisted copy of this object.
-
#hashback_backend ⇒ Object
Convenience method for accessing the backend without having to get to the obscurely-named class variable in which it’s stored.
-
#save ⇒ Object
Saves the serialized form of this object to the configured backend store.
Instance Method Details
#destroy ⇒ Object
Destroy the persisted copy of this object.
29 30 31 |
# File 'lib/hashback/resource.rb', line 29 def destroy hashback_backend.delete(_hashback_id_key) end |
#hashback_backend ⇒ Object
Convenience method for accessing the backend without having to get to the obscurely-named class variable in which it’s stored.
35 36 37 |
# File 'lib/hashback/resource.rb', line 35 def hashback_backend self.class.__send__(:class_variable_get, :@@_backend) end |
#save ⇒ Object
Saves the serialized form of this object to the configured backend store.
24 25 26 |
# File 'lib/hashback/resource.rb', line 24 def save hashback_backend[_hashback_id_key] = self end |