class Racc::ISet
An “indexed” set. All items must respond to :ident.
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/racc/iset.rb, line 28 def [](key) @set[key.ident] end
Source
# File lib/racc/iset.rb, line 54 def delete(key) i = @set[key.ident] @set[key.ident] = nil i end
Source
# File lib/racc/iset.rb, line 60 def each(&block) @set.compact.each(&block) end
Source
# File lib/racc/iset.rb, line 68 def to_s "[#{@set.compact.join(' ')}]" end
Also aliased as: inspect
Source
# File lib/racc/iset.rb, line 39 def update(other) s = @set o = other.set o.each_index do |idx| if t = o[idx] s[idx] = t end end end
Source
# File lib/racc/iset.rb, line 49 def update_a(a) s = @set a.each {|i| s[i.ident] = i } end