class Lingo::Language::LexicalHash

Public Class Methods

new(id, lingo) click to toggle source
# File lib/lingo/language/lexical_hash.rb, line 44
def initialize(id, lingo)
  @src = Database.open(id, lingo)
end
open(*args) { |lexical_hash = new(*args)| ... } click to toggle source
# File lib/lingo/language/lexical_hash.rb, line 38
def self.open(*args)
  yield lexical_hash = new(*args)
ensure
  lexical_hash.close if lexical_hash
end

Public Instance Methods

[](key) click to toggle source
# File lib/lingo/language/lexical_hash.rb, line 52
def [](key)
  Database::Source.lexicals(@src[Unicode.downcase(key)])
end
close() click to toggle source
# File lib/lingo/language/lexical_hash.rb, line 48
def close
  @src.close
end