A constant
Methods
- #
- D
- F
- I
- M
- N
- P
- S
Constants
MARSHAL_VERSION | = | 0 |
Attributes
[W] | is_alias_for | Sets the module or class this is constant is an alias for. |
[RW] | name | The constant's name |
[RW] | value | The constant's value |
[RW] | visibility | The constant's visibility |
Class Public methods
new(name, value, comment)
Link
Creates a new constant with name
, value
and
comment
Instance Public methods
<=>(other)
Link
Constants are ordered by name
==(other)
Link
documented?()
Link
A constant is documented if it has a comment, or is an alias for a documented class or module.
full_name()
Link
Full constant name including namespace
is_alias_for()
Link
The module or class this constant is an alias for
marshal_dump()
Link
Dumps this Constant for use by ri. See also marshal_load
# File lib/rdoc/constant.rb, line 100 def marshal_dump alias_name = case found = is_alias_for when RDoc::CodeObject then found.full_name else found end [ MARSHAL_VERSION, @name, full_name, @visibility, alias_name, parse(@comment), @file.relative_name, parent.name, parent.class, section.title, ] end
marshal_load(array)
Link
Loads this Constant from array
.
For a loaded Constant the following methods
will return cached values:
# File lib/rdoc/constant.rb, line 126 def marshal_load array initialize array[1], nil, array[5] @full_name = array[2] @visibility = array[3] @is_alias_for = array[4] # 5 handled above # 6 handled below @parent_name = array[7] @parent_class = array[8] @section_title = array[9] @file = RDoc::TopLevel.new array[6] end
path()
Link
Path to this constant for use with HTML generator output.