Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

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

Class/Module Index [+]



A constant



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


The constant’s name


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)
  @name = name
  @value = value
  @is_alias_for = nil
  self.comment = comment

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]
==(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
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?
path() click to toggle source

Path to this constant

               # File rdoc/constant.rb, line 72
def path

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.