~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to lib/rdoc/normal_class.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
class RDoc::NormalClass < RDoc::ClassModule
7
7
 
8
8
  ##
9
 
  # Ancestor ClassModules
 
9
  # Appends the superclass, if any, to the included modules.
10
10
 
11
11
  def ancestors
12
 
    includes + [superclass]
 
12
    superclass ? super + [superclass] : super
 
13
  end
 
14
 
 
15
  ##
 
16
  # The definition of this class, <tt>class MyClassName</tt>
 
17
 
 
18
  def definition
 
19
    "class #{full_name}"
13
20
  end
14
21
 
15
22
  def inspect # :nodoc:
20
27
    ]
21
28
  end
22
29
 
 
30
  def to_s # :nodoc:
 
31
    display = "#{self.class.name} #{self.full_name}"
 
32
    if superclass
 
33
      display << ' < ' << (superclass.is_a?(String) ? superclass : superclass.full_name)
 
34
    end
 
35
    display << ' -> ' << is_alias_for.to_s if is_alias_for
 
36
    display
 
37
  end
 
38
 
23
39
  def pretty_print q # :nodoc:
24
40
    superclass = @superclass ? " < #{@superclass}" : nil
25
41