class Hikki::Adapters::Adapter

Attributes

collections[R]

Public Class Methods

new() click to toggle source
# File lib/hikki/adapters/adapter.rb, line 6
def initialize
  @collections = {}
end

Public Instance Methods

all(collection, options={}) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 22
def all(collection, options={})
  collection_for(collection).all(options)
end
collection_for(collection) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 38
def collection_for(collection)
  collections.fetch(collection, Collection.new(collection, store, uuid_generator))
end
find(collection, id) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 18
def find(collection, id)
  collection_for(collection).find(id)
end
find_by(collection, field, value, options={}) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 26
def find_by(collection, field, value, options={})
  collection_for(collection).find_by(field, value, options)
end
index(collection, field) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 10
def index(collection, field)
  collection_for(collection).index(field)
end
remove(collection, id) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 30
def remove(collection, id)
  collection_for(collection).remove(id)
end
remove_all(collection) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 34
def remove_all(collection)
  collection_for(collection).remove_all
end
save(collection, data) click to toggle source
# File lib/hikki/adapters/adapter.rb, line 14
def save(collection, data)
  collection_for(collection).save(data)
end