Class: Tap::Support::Lazydoc::Method

Inherits:
Comment show all
Defined in:
lib/tap/support/lazydoc/method.rb

Instance Attribute Summary

Attributes inherited from Comment

#content, #line_number, #subject

Instance Method Summary collapse

Methods inherited from Comment

#<<, #==, #append, #empty?, #initialize, parse, #prepend, #push, scan, #to_s, #trim, #unshift, #value, #value=, wrap, #wrap

Constructor Details

This class inherits a constructor from Tap::Support::Lazydoc::Comment

Instance Method Details

#resolve(lines) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tap/support/lazydoc/method.rb', line 5

def resolve(lines)
  super
  @subject =~ /def \w+(\((.*?)\))?/

  args = $2.to_s.split(',').collect do |arg|
    arg = arg.strip.upcase
    case arg
    when /^&/ then nil
    when /^\*/ then arg[1..-1] + "..."
    else arg
    end
  end

  @subject = args.join(' ')
  self
end