In Files

  • rdoc/constant.rb
  • rdoc/generator/markup.rb

Class/Module Index [+]

Quicksearch

RDoc::Constant

A constant

Attributes

is_alias_for[RW]

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

name[RW]

The constant's name

value[RW]

The constant's value

Public Class Methods

new(name, value, comment) click to toggle source

Creates a new constant with name, value and comment

 
               # File rdoc/constant.rb, line 28
def initialize(name, value, comment)
  super()
  @name = name
  @value = value
  @is_alias_for = nil
  self.comment = comment
end
            

Public Instance Methods

<=>(other) click to toggle source

Constants are ordered by name

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

  [parent_name, name] <=> [other.parent_name, other.name]
end
            
==(other) click to toggle source

Constants are equal when their parent and name is the same

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

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

 
               # File rdoc/constant.rb, line 58
def documented?
  super or is_alias_for && is_alias_for.documented?
end
            
path() click to toggle source

Path to this constant

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