Module: Schron::Repository

Includes:
Archive, Archive::Interface, Interface
Defined in:
lib/schron/repository.rb,
lib/schron/repository/interface.rb

Defined Under Namespace

Modules: Interface

Instance Attribute Summary

Attributes included from Archive

#datastore, #entity_class, #indexed_fields, #kind

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Archive

#all, #dump, #dump_all, #first, #get, #initialize, #insert, #load, #load_all, #multi_get, #multi_insert, #query

Methods included from Archive::Interface

#dump, #dump_all, #first, #get, #identity, #insert, #load, #load_all, #multi_get, #multi_insert, #query

Methods included from Interface

#dump, #load

Class Method Details

.included(archive_class) ⇒ Object



14
15
16
# File 'lib/schron/repository.rb', line 14

def self.included(archive_class)
  archive_class.extend Schron::DSL
end

Instance Method Details

#multi_remove(ids) ⇒ Object



30
31
32
# File 'lib/schron/repository.rb', line 30

def multi_remove(ids)
  @datastore.multi_remove(@kind, ids) && nil
end

#multi_update(objects) ⇒ Object



22
23
24
# File 'lib/schron/repository.rb', line 22

def multi_update(objects)
  load_all(@datastore.multi_update(@kind, dump_all(objects)))
end

#remove(id) ⇒ Object



26
27
28
# File 'lib/schron/repository.rb', line 26

def remove(id)
  @datastore.remove(@kind, id) && nil
end

#update(object) ⇒ Object



18
19
20
# File 'lib/schron/repository.rb', line 18

def update(object)
  maybe_load(@datastore.update(@kind, dump(object)))
end