Class Tap::Declarations::Description
In: lib/tap/declarations/description.rb
Parent: Lazydoc::Comment

A special type of Lazydoc::Comment designed to handle the comment syntax for task declarations.

Description instances can be assigned a description, or they may parse one directly from the comment. Comment lines with the constant attribute ’::’ will have the value set as desc.

Methods

prepend   to_s  

Attributes

desc  [RW]  The description for self.

Public Instance methods

Parses in-comment descriptions from prepended lines, if present.

[Source]

    # File lib/tap/declarations/description.rb, line 17
17:       def prepend(line)
18:         if line =~ /\s::(?:\s+(.*?)\s*)?$/
19:           self.desc = $1.to_s
20:           false
21:         else
22:           super
23:         end
24:       end

Resolves and returns the description.

[Source]

    # File lib/tap/declarations/description.rb, line 27
27:       def to_s
28:         resolve
29:         desc.to_s
30:       end

[Validate]