Class: RDoc::AnyMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/gerbil/rdoc.rb

Instance Method Summary collapse

Instance Method Details

#comment_htmlObject

Returns a HTML version of this method’s comment.



94
95
96
# File 'lib/gerbil/rdoc.rb', line 94

def comment_html
  DummyMarkup.new.markup comment
end

#declObject

Returns a complete method declaration with block parameters and all.



84
85
86
87
88
89
90
91
# File 'lib/gerbil/rdoc.rb', line 84

def decl
  a = params.dup
  if b = block_params
    a.sub! %r/\s*\#.*(?=.$)/, '' # remove "# :yields: ..." string
    a << " {|#{b}| ... }"
  end
  full_name << a
end

#full_nameObject

Returns the fully qualified name of this method.



79
80
81
# File 'lib/gerbil/rdoc.rb', line 79

def full_name
  [parent.full_name, name].join(singleton ? '::' : '#')
end

#top_levelObject

Returns the RDoc::TopLevel object which contains this method.



99
100
101
102
103
104
105
# File 'lib/gerbil/rdoc.rb', line 99

def top_level
  n = parent
  while n && n.parent
    n = n.parent
  end
  n
end