diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-14 11:39:21 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-14 11:39:21 +0000 |
commit | e76eb06feb024828034379797129d92522e28516 (patch) | |
tree | 1326c625c233ba2554043203a7697f5e3d4c49e5 /ruby_1_9_3/lib/rdoc/constant.rb | |
parent | aa6e98139c8e1ea442fb2182341aaa08ff55b529 (diff) | |
parent | bede15ac5e701ed08f3fc64c2dba03d3f393c652 (diff) |
add tag v1_9_3_426v1_9_3_426
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_3_426@40737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_1_9_3/lib/rdoc/constant.rb')
-rw-r--r-- | ruby_1_9_3/lib/rdoc/constant.rb | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/ruby_1_9_3/lib/rdoc/constant.rb b/ruby_1_9_3/lib/rdoc/constant.rb deleted file mode 100644 index 056ce130be..0000000000 --- a/ruby_1_9_3/lib/rdoc/constant.rb +++ /dev/null @@ -1,86 +0,0 @@ -require 'rdoc/code_object' - -## -# A constant - -class RDoc::Constant < RDoc::CodeObject - - ## - # If this constant is an alias for a module or class, - # this is the RDoc::ClassModule it is an alias for. - # +nil+ otherwise. - - attr_accessor :is_alias_for - - ## - # The constant's name - - attr_accessor :name - - ## - # The constant's value - - attr_accessor :value - - ## - # Creates a new constant with +name+, +value+ and +comment+ - - def initialize(name, value, comment) - super() - @name = name - @value = value - @is_alias_for = nil - self.comment = comment - end - - ## - # Constants are ordered by name - - def <=> other - return unless self.class === other - - [parent_name, name] <=> [other.parent_name, other.name] - end - - ## - # Constants are equal when their #parent and #name is the same - - def == other - self.class == other.class and - @parent == other.parent and - @name == other.name - end - - ## - # A constant is documented if it has a comment, or is an alias - # for a documented class or module. - - def documented? - super or is_alias_for && is_alias_for.documented? - end - - def inspect # :nodoc: - "#<%s:0x%x %s::%s>" % [ - self.class, object_id, - parent_name, @name, - ] - end - - ## - # Path to this constant - - def path - "#{@parent.path}##{@name}" - end - - def to_s # :nodoc: - parent_name = parent ? parent.full_name : '(unknown)' - if is_alias_for - "constant #{parent_name}::#@name -> #{is_alias_for}" - else - "constant #{parent_name}::#@name" - end - end - -end - |