Module: HashPersistent::Resource::ClassMethods
- Defined in:
- lib/hash-persistent/resource.rb
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
21 22 23 |
# File 'lib/hash-persistent/resource.rb', line 21 def prefix @prefix end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
21 22 23 |
# File 'lib/hash-persistent/resource.rb', line 21 def store @store end |
Instance Method Details
#find(key) ⇒ Object
23 24 25 |
# File 'lib/hash-persistent/resource.rb', line 23 def find(key) @store[@prefix + key] end |
#on_delete(&block) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/hash-persistent/resource.rb', line 35 def on_delete(&block) if block @on_delete = block else @on_delete end end |
#on_save(&block) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/hash-persistent/resource.rb', line 27 def on_save(&block) if block @on_save = block else @on_save end end |