Module: Friendly::Document::Storage::ClassMethods

Defined in:
lib/friendly/document/storage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#query_klassObject



40
41
42
# File 'lib/friendly/document/storage.rb', line 40

def query_klass
  @query_klass ||= Query
end

#storage_proxyObject



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)
  options = fields.last.is_a?(Hash) ? fields.pop : {}
  storage_proxy.cache(fields, options)
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