Class: RDoc::AnyMethod

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

Instance Method Summary collapse

Instance Method Details

#comment_htmlObject

Returns a HTML version of this method’s comment.



116
117
118
# File 'lib/erbook/rdoc.rb', line 116

def comment_html
  DummyMarkup.new.markup comment
end

#declObject

Returns a complete method declaration with block parameters and all.



102
103
104
105
106
107
108
109
110
111
# File 'lib/erbook/rdoc.rb', line 102

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.



95
96
97
# File 'lib/erbook/rdoc.rb', line 95

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

#top_levelObject

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



123
124
125
126
127
128
129
130
131
# File 'lib/erbook/rdoc.rb', line 123

def top_level
  n = parent

  while n && n.parent
    n = n.parent
  end

  n
end