Class: Moodwall::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/moodwall/repository.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store = PStore.new("database.pstore")) ⇒ Repository

Returns a new instance of Repository.



7
8
9
# File 'lib/moodwall/repository.rb', line 7

def initialize(store = PStore.new("database.pstore"))
  @store = store
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



5
6
7
# File 'lib/moodwall/repository.rb', line 5

def store
  @store
end

Class Method Details

.resetObject



15
16
17
18
19
20
# File 'lib/moodwall/repository.rb', line 15

def self.reset
  store = self.store
  store.transaction do
    store.roots.each { |r| store.delete r }
  end
end

.storeObject



11
12
13
# File 'lib/moodwall/repository.rb', line 11

def self.store
  new.store
end