summaryrefslogtreecommitdiff
path: root/lib/rbot/registry/mem.rb
blob: 0664ad395b7b132b4e55a1d30baa6c0c4f228ad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#-- vim:sw=2:et
#++
#
# :title: Memory registry implementation
#
# This is using a in-memory hash, does not persist, used for
# tests, etc.
#

module Irc
class Bot
class Registry

  class MemAccessor < AbstractAccessor

    def initialize(filename)
      super(filename)
      @data = {}
    end

    def registry
      super
      @registry = @data
    end

    def close
    end

    def flush
    end

    def dbexists?
      true  # the memory database always exists, this way it won't create any folders on the file system
    end

  end

end # Registry
end # Bot
end # Irc