Class: WIKI::W

Inherits:
Object
  • Object
show all
Defined in:
lib/meiou/wiki.rb

Instance Method Summary collapse

Constructor Details

#initialize(k) ⇒ W

Returns a new instance of W.



45
46
47
48
# File 'lib/meiou/wiki.rb', line 45

def initialize k
  @id = k
  @x = PStore.new("db/w-#{k}.pstore")
end

Instance Method Details

#[](k) ⇒ Object



49
50
51
# File 'lib/meiou/wiki.rb', line 49

def [] k
  @x.transaction { |db| db[k] }
end

#[]=(k, v) ⇒ Object



52
53
54
# File 'lib/meiou/wiki.rb', line 52

def []= k,v
  @x.transaction { |db| db[k] = v }
end

#idObject



55
# File 'lib/meiou/wiki.rb', line 55

def id; @id; end