Class: Ghaki::Meta::Dict::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ghaki/meta/dict/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



23
24
25
26
# File 'lib/ghaki/meta/dict/base.rb', line 23

def initialize
  @storage = Storage.new
  @lookups = {}
end

Class Method Details

.dict_lookup_rule(*words) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ghaki/meta/dict/base.rb', line 10

def self.dict_lookup_rule *words
  list = []
  words.each do |word|
    list.push <<-"END"
      def #{word}
        @lookups[ :#{word} ] ||=
          Lookup.new( :#{word}, :dict_storage => @storage )
      end
    END
  end
  class_eval list.join("\n")
end