Module: MOOD
- Defined in:
- lib/meiou/mood.rb
Constant Summary collapse
- @@MOOD =
PStore.new("db/moods.pstore")
Class Method Summary collapse
Class Method Details
.[](p) ⇒ Object
5 6 7 |
# File 'lib/meiou/mood.rb', line 5 def self.[] k @@MOOD.transaction { |db| db[k] } end |
.decr(k, *n) ⇒ Object
14 15 16 |
# File 'lib/meiou/mood.rb', line 14 def self.decr k, *n @@MOOD.transaction { |db| x = db[k].to_f; db[k] = x + n[0] || 1 } end |
.incr(k, n) ⇒ Object
11 12 13 |
# File 'lib/meiou/mood.rb', line 11 def self.incr k, n @@MOOD.transaction { |db| x = db[k].to_f; db[k] = x + n[0] || 1 } end |
.keys ⇒ Object
8 9 10 |
# File 'lib/meiou/mood.rb', line 8 def self.keys @@MOOD.transaction { |db| db.keys } end |