class Doxyparser::Node

A Node can be any member of the tree-like structure of a C/C++ header file.

examples are namespaces, classes, methods, params, etc

Attributes

basename[R]
dir[R]
doc[R]
name[R]
node[R]
parent[RW]

Public Class Methods

new(hash) click to toggle source

Takes a hash as input with following keys: :node, :parent, :dir, :name

# File lib/nodes/node.rb, line 32
def initialize(hash)
  @dir = hash[:dir]
  @name = hash[:name]
  if hash[:node] # If a reference to an xml declaration (node) is given
    @node = hash[:node]
    @parent = hash[:parent]
    @name = find_name
    if @name =~ /PxVec3.h/
            @name = find_name
    end
    @dir ||= @parent.dir unless @parent.nil?
  end
  raise "No name given for node: #{self.class.name}" unless @name
  raise "No xml directory given for node: #{self.class.name}" unless @dir
  init_attributes
end

Public Instance Methods

==(another) click to toggle source
# File lib/nodes/node.rb, line 15
def == another
  self.name == another.name
end
eql?(another) click to toggle source
# File lib/nodes/node.rb, line 19
def eql?(another)
  self.name == another.name
end
escaped_name() click to toggle source
# File lib/nodes/node.rb, line 49
def escaped_name
    name
end
to_s() click to toggle source
# File lib/nodes/node.rb, line 27
def to_s
  @name
end
to_str() click to toggle source
# File lib/nodes/node.rb, line 23
def to_str
  @name
end

Private Instance Methods

del_prefix_for(str) click to toggle source
# File lib/nodes/node.rb, line 71
def del_prefix_for(str)
  del_prefix_class(str)
end
find_name() click to toggle source
# File lib/nodes/node.rb, line 67
def find_name
  # For Inheritance
end
init_attributes() click to toggle source
# File lib/nodes/node.rb, line 63
def init_attributes
  @basename ||= del_prefix_for(@name)
end
method_missing(sym, *args) click to toggle source
Calls superclass method
# File lib/nodes/node.rb, line 55
def method_missing(sym, *args)
  if @node.respond_to?(sym)
    @node.send(sym, *args)
  else
    @node[sym.to_s] || super
  end
end