Module: KLookup::Lookup

Defined in:
lib/klookup/lookup.rb

Overview

A module containing abstract classes representing Radical and Kanji.

Defined Under Namespace

Classes: Kanji, Radical

Class Method Summary collapse

Class Method Details

.default_handlerObject

Returns the default handler for database lookups.



17
18
19
20
21
22
23
24
25
# File 'lib/klookup/lookup.rb', line 17

def self.default_handler
  return KLookup::Database::FlatFile
  begin
    KLookup::Database::SQLite.instance
    KLookup::Database::SQLite
  rescue LoadError
    KLookup::Database::FlatFile
  end
end

.handler=(h) ⇒ Object

Set the handler used by both Kanji and Radical.



28
29
30
31
# File 'lib/klookup/lookup.rb', line 28

def self.handler=(h)
  KLookup::Lookup::Kanji.handler=h
  KLookup::Lookup::Radical.handler=h
end