class DocDiff::Diff::Alphabet

Public Class Methods

new() click to toggle source
# File lib/docdiff/diff.rb, line 196
def initialize
  @hash = {}
end

Public Instance Methods

add(v) click to toggle source
# File lib/docdiff/diff.rb, line 200
def add(v)
  if @hash.include? v
    return @hash[v]
  else
    return @hash[v] = @hash.size
  end
end
index(v) click to toggle source
# File lib/docdiff/diff.rb, line 210
def index(v)
  return @hash.fetch {raise NoSymbol.new(v.to_s)}
end
size() click to toggle source
# File lib/docdiff/diff.rb, line 214
def size
  return @hash.size
end