A constant

Methods
#
D
N
P
Included Modules
Attributes
[RW] is_alias_for

If this constant is an alias for a module or class, this is the RDoc::ClassModule it is an alias for. nil otherwise.

[RW] name

The constant's name

[RW] value

The constant's value

Class Public methods
new(name, value, comment)

Creates a new constant with name, value and comment

# File ../ruby/lib/rdoc/constant.rb, line 28
def initialize(name, value, comment)
  super()
  @name = name
  @value = value
  @is_alias_for = nil
  self.comment = comment
end
Instance Public methods
<=>(other)

Constants are ordered by name

# File ../ruby/lib/rdoc/constant.rb, line 39
def <=> other
  return unless self.class === other

  [parent_name, name] <=> [other.parent_name, other.name]
end
==(other)

Constants are equal when their parent and name is the same

# File ../ruby/lib/rdoc/constant.rb, line 48
def == other
  self.class == other.class and
    @parent == other.parent and
    @name == other.name
end
documented?()

A constant is documented if it has a comment, or is an alias for a documented class or module.

# File ../ruby/lib/rdoc/constant.rb, line 58
def documented?
  super or is_alias_for && is_alias_for.documented?
end
path()

Path to this constant

# File ../ruby/lib/rdoc/constant.rb, line 72
def path
  "#{@parent.path}##{@name}"
end