Class: WIKI::W
- Inherits:
-
Object
- Object
- WIKI::W
- Defined in:
- lib/meiou/wiki.rb
Instance Method Summary collapse
- #[](k) ⇒ Object
- #[]=(k, v) ⇒ Object
- #id ⇒ Object
-
#initialize(k) ⇒ W
constructor
A new instance of W.
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 |
#id ⇒ Object
55 |
# File 'lib/meiou/wiki.rb', line 55 def id; @id; end |