class ReVIEW::LaTeXIndex

Public Class Methods

new(table) click to toggle source
# File lib/review/latexindex.rb, line 25
def initialize(table)
  @table = table
end

Public Instance Methods

[](key) click to toggle source
# File lib/review/latexindex.rb, line 29
def [](key)
  @table.fetch(key)
end
load(path) click to toggle source
# File lib/review/latexindex.rb, line 16
def load(path)
  table = {}
  File.foreach(path) do |line|
    key, value = *line.strip.split(/\t+/, 2)
    table[key.sub(/\A%/, '')] = value
  end
  new(table)
end