Class: JEDICT::DictionaryProxy
- Inherits:
-
Object
- Object
- JEDICT::DictionaryProxy
- Defined in:
- lib/jedict.rb
Instance Method Summary collapse
- #count ⇒ Object
- #each_entry(&blck) ⇒ Object
-
#initialize(filename, eager_load) ⇒ DictionaryProxy
constructor
A new instance of DictionaryProxy.
- #method_missing(sym, *args, &blck) ⇒ Object
Constructor Details
#initialize(filename, eager_load) ⇒ DictionaryProxy
Returns a new instance of DictionaryProxy.
42 43 44 45 |
# File 'lib/jedict.rb', line 42 def initialize filename, eager_load @filename = filename @dic = eager_load ? JEDICT::load_file(filename) : nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &blck) ⇒ Object
37 38 39 40 |
# File 'lib/jedict.rb', line 37 def method_missing sym, *args, &blck return @dic.send(sym, *args, &blck) if @dic && @dic.respond_to?(sym) super end |