class Ctc::Kanji2Ctc

Public Class Methods

find(kanji) click to toggle source
# File lib/ctc/kanji_2_ctc.rb, line 3
def self.find(kanji)
  mappings.fetch(kanji) do
    raise Ctc::KanjiNotFoundError.new("Kanji not found.")
  end
end

Private Class Methods

mappings() click to toggle source
# File lib/ctc/kanji_2_ctc.rb, line 10
def self.mappings
  return @mappings if @mappings

  yaml_file = File.expand_path("../../config/kanji_2_ctc.yml", File.dirname(__FILE__))
  @mappings = YAML.load_file(yaml_file)
  @mappings
end