class IDL::AST::Annotations

Public Class Methods

new() click to toggle source
# File lib/ridl/node.rb, line 50
def initialize
  @index = {}
  @stack = []
end

Public Instance Methods

<<(ann) click to toggle source
# File lib/ridl/node.rb, line 63
def <<(ann)
  (@index[ann.id] ||= []) << @stack.size
  @stack << ann
end
[](annid) click to toggle source
# File lib/ridl/node.rb, line 59
def [](annid)
  (@index[annid] || []).collect { |ix| @stack[ix] }
end
concat(anns) click to toggle source
# File lib/ridl/node.rb, line 76
def concat(anns)
  anns.each { |_ann| self << _ann } if anns
end
each(&block) click to toggle source
# File lib/ridl/node.rb, line 68
def each(&block)
  @stack.each(&block)
end
each_for_id(annid, &block) click to toggle source
# File lib/ridl/node.rb, line 72
def each_for_id(annid, &block)
  self[annid].each(&block)
end
empty?() click to toggle source
# File lib/ridl/node.rb, line 55
def empty?
  @stack.empty?
end