Module: Friendly::Document::Storage::ClassMethods
- Defined in:
- lib/friendly/document/storage.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #all(query) ⇒ Object
- #caches_by(*fields) ⇒ Object
- #count(conditions) ⇒ Object
- #create_tables! ⇒ Object
- #first(query) ⇒ Object
- #indexes(*args) ⇒ Object
Instance Attribute Details
#query_klass ⇒ Object
40 41 42 |
# File 'lib/friendly/document/storage.rb', line 40 def query_klass @query_klass ||= Query end |
#storage_proxy ⇒ Object
15 16 17 |
# File 'lib/friendly/document/storage.rb', line 15 def storage_proxy @storage_proxy ||= StorageProxy.new(self) end |
Instance Method Details
#all(query) ⇒ Object
32 33 34 |
# File 'lib/friendly/document/storage.rb', line 32 def all(query) storage_proxy.all(query(query)) end |
#caches_by(*fields) ⇒ Object
23 24 25 26 |
# File 'lib/friendly/document/storage.rb', line 23 def caches_by(*fields) = fields.last.is_a?(Hash) ? fields.pop : {} storage_proxy.cache(fields, ) end |
#count(conditions) ⇒ Object
36 37 38 |
# File 'lib/friendly/document/storage.rb', line 36 def count(conditions) storage_proxy.count(query(conditions)) end |
#create_tables! ⇒ Object
11 12 13 |
# File 'lib/friendly/document/storage.rb', line 11 def create_tables! storage_proxy.create_tables! end |
#first(query) ⇒ Object
28 29 30 |
# File 'lib/friendly/document/storage.rb', line 28 def first(query) storage_proxy.first(query(query)) end |
#indexes(*args) ⇒ Object
19 20 21 |
# File 'lib/friendly/document/storage.rb', line 19 def indexes(*args) storage_proxy.add(args) end |