Sha256: c933f2a5fb9c6d494cc3c4f8b7bb37410063cd4b4a7057d203601303d7b82559
Contents?: true
Size: 457 Bytes
Versions: 7
Compression:
Stored size: 457 Bytes
Contents
module AsciiMath class SymbolTableBuilder def initialize() @table = {} end def add(*args) raise 'Insufficient arguments' if args.length < 3 entry = {} if args.last.is_a?(Hash) entry.merge!(args.pop) end entry[:type] = args.pop entry[:value] = args.pop entry.freeze args.each { |name| @table[name.freeze] = entry } end def build @table.dup.freeze end end end
Version data entries
7 entries across 7 versions & 2 rubygems