Class: TomParse::TomDoc
- Inherits:
-
Object
- Object
- TomParse::TomDoc
- Defined in:
- lib/tomparse.rb
Overview
Encapsulate parsed tomdoc documentation.
TODO: Currently uses lazy evaluation, eventually this should be removed and simply parsed all at once.
Instance Attribute Summary collapse
-
#raw ⇒ Object
Returns the value of attribute raw.
Class Method Summary collapse
-
.valid?(text) ⇒ Boolean
Validate given comment text.
Instance Method Summary collapse
-
#arguments ⇒ Object
(also: #args)
Arguments list.
-
#deprecated? ⇒ Boolean
Check if method is deprecated.
-
#description ⇒ Object
Description of method or class/module.
-
#examples ⇒ Object
List of use examples of a method or class/module.
-
#initialize(text, parse_options = {}) ⇒ TomDoc
constructor
Public: Initialize a TomDoc object.
-
#internal? ⇒ Boolean
Check if method is internal.
-
#options ⇒ Object
(also: #keyword_arguments)
Keyword arguments, aka Options.
-
#public? ⇒ Boolean
Check if method is public.
-
#raises ⇒ Object
A list of errors a method might raise.
-
#returns ⇒ Object
The list of retrun values a method can return.
-
#sections ⇒ Object
List of comment sections.
-
#signature_fields ⇒ Object
Deprecated: A list of signature fields.
-
#signatures ⇒ Object
A list of alternate method signatures.
-
#tags ⇒ Object
(also: #labels)
List of tags.
-
#to_s ⇒ Object
Raw documentation text.
-
#tomdoc ⇒ Object
The raw comment text cleaned-up and ready for section parsing.
-
#valid? ⇒ Boolean
Validate raw comment.
-
#validate ⇒ Object
Validate raw comment.
-
#yields ⇒ Object
Description of a methods yield procedure.
Constructor Details
Instance Attribute Details
#raw ⇒ Object
Returns the value of attribute raw.
23 24 25 |
# File 'lib/tomparse.rb', line 23 def raw @raw end |
Class Method Details
.valid?(text) ⇒ Boolean
Validate given comment text.
Returns true if comment is valid, otherwise false.
45 46 47 |
# File 'lib/tomparse.rb', line 45 def self.valid?(text) new(text).valid? end |
Instance Method Details
#arguments ⇒ Object Also known as: args
Arguments list.
Returns list of arguments.
90 91 92 |
# File 'lib/tomparse.rb', line 90 def arguments @parser.arguments end |
#deprecated? ⇒ Boolean
Check if method is deprecated.
Returns true if method is deprecated.
175 176 177 |
# File 'lib/tomparse.rb', line 175 def deprecated? @parser.deprecated? end |
#description ⇒ Object
Description of method or class/module.
Returns description String.
83 84 85 |
# File 'lib/tomparse.rb', line 83 def description @parser.description end |
#examples ⇒ Object
List of use examples of a method or class/module.
Returns String of examples.
106 107 108 |
# File 'lib/tomparse.rb', line 106 def examples @parser.examples end |
#internal? ⇒ Boolean
Check if method is internal.
Returns true if method is internal.
168 169 170 |
# File 'lib/tomparse.rb', line 168 def internal? @parser.internal? end |
#options ⇒ Object Also known as: keyword_arguments
Keyword arguments, aka Options.
Returns list of options.
98 99 100 |
# File 'lib/tomparse.rb', line 98 def @parser. end |
#public? ⇒ Boolean
Check if method is public.
Returns true if method is public.
161 162 163 |
# File 'lib/tomparse.rb', line 161 def public? @parser.public? end |
#raises ⇒ Object
A list of errors a method might raise.
Returns Array of method raises descriptions.
127 128 129 |
# File 'lib/tomparse.rb', line 127 def raises @parser.raises end |
#returns ⇒ Object
The list of retrun values a method can return.
Returns Array of method return descriptions.
120 121 122 |
# File 'lib/tomparse.rb', line 120 def returns @parser.returns end |
#sections ⇒ Object
List of comment sections. These are divided simply on "\n\n".
Returns Array of comment sections.
76 77 78 |
# File 'lib/tomparse.rb', line 76 def sections @parser.sections end |
#signature_fields ⇒ Object
Deprecated: A list of signature fields.
TODO: Presently this will always return an empty list. It will either be removed or renamed in future version.
Returns Array of field definitions.
144 145 146 |
# File 'lib/tomparse.rb', line 144 def signature_fields @parser.signature_fields end |
#signatures ⇒ Object
A list of alternate method signatures.
Returns Array of signatures.
134 135 136 |
# File 'lib/tomparse.rb', line 134 def signatures @parser.signatures end |
#tags ⇒ Object Also known as: labels
List of tags.
Returns an associatve array of tags. [Array<Array
151 152 153 |
# File 'lib/tomparse.rb', line 151 def @parser. end |
#to_s ⇒ Object
Raw documentation text.
Returns String of raw documentation text.
38 39 40 |
# File 'lib/tomparse.rb', line 38 def to_s @parser.raw end |
#tomdoc ⇒ Object
The raw comment text cleaned-up and ready for section parsing.
Returns cleaned-up comment String.
69 70 71 |
# File 'lib/tomparse.rb', line 69 def tomdoc return @parser.tomdoc end |
#valid? ⇒ Boolean
Validate raw comment.
Returns true if comment is valid, otherwise false.
52 53 54 |
# File 'lib/tomparse.rb', line 52 def valid? @parser.valid? end |
#validate ⇒ Object
Validate raw comment.
Returns true if comment is valid. Raises ParseError if comment is not valid.
60 61 62 |
# File 'lib/tomparse.rb', line 60 def validate @parser.validate end |
#yields ⇒ Object
Description of a methods yield procedure.
Returns String decription of yield procedure.
113 114 115 |
# File 'lib/tomparse.rb', line 113 def yields @parser.yields end |