Class: TomParse::TomDoc
- Inherits:
-
Object
- Object
- TomParse::TomDoc
- Defined in:
- lib/tomparse.rb
Overview
Currently uses lazy evaluation, eventually this should be removed and simply parsed all at once.
Encapsulate parsed tomdoc documentation.
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 ⇒ String
List of use examples of a method or class/module.
-
#initialize(text, parse_options = {}) ⇒ Object
constructor
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 ⇒ Array
A list of errors a method might raise.
-
#returns ⇒ Array
The list of retrun values a method can return.
-
#sections ⇒ Array
List of comment sections.
-
#signature_fields ⇒ Array
deprecated
Deprecated.
Do not use this in new code, and replace it when updating old code.
-
#signatures ⇒ Array
A list of alternate method signatures.
-
#tags ⇒ Array<Array<String>>
List of tags.
-
#to_s ⇒ String
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 ⇒ String
Description of a methods yield procedure.
Constructor Details
Instance Attribute Details
#raw ⇒ Object
Returns the value of attribute raw.
22 23 24 |
# File 'lib/tomparse.rb', line 22 def raw @raw end |
Class Method Details
.valid?(text) ⇒ Boolean
Validate given comment text.
44 45 46 |
# File 'lib/tomparse.rb', line 44 def self.valid?(text) new(text).valid? end |
Instance Method Details
#arguments ⇒ Object Also known as: args
Arguments list.
89 90 91 |
# File 'lib/tomparse.rb', line 89 def arguments @parser.arguments end |
#deprecated? ⇒ Boolean
Check if method is deprecated.
171 172 173 |
# File 'lib/tomparse.rb', line 171 def deprecated? @parser.deprecated? end |
#description ⇒ Object
Description of method or class/module.
82 83 84 |
# File 'lib/tomparse.rb', line 82 def description @parser.description end |
#examples ⇒ String
List of use examples of a method or class/module.
105 106 107 |
# File 'lib/tomparse.rb', line 105 def examples @parser.examples end |
#internal? ⇒ Boolean
Check if method is internal.
164 165 166 |
# File 'lib/tomparse.rb', line 164 def internal? @parser.internal? end |
#options ⇒ Object Also known as: keyword_arguments
Keyword arguments, aka Options.
97 98 99 |
# File 'lib/tomparse.rb', line 97 def @parser. end |
#public? ⇒ Boolean
Check if method is public.
157 158 159 |
# File 'lib/tomparse.rb', line 157 def public? @parser.public? end |
#raises ⇒ Array
A list of errors a method might raise.
126 127 128 |
# File 'lib/tomparse.rb', line 126 def raises @parser.raises end |
#returns ⇒ Array
The list of retrun values a method can return.
119 120 121 |
# File 'lib/tomparse.rb', line 119 def returns @parser.returns end |
#sections ⇒ Array
List of comment sections. These are divided simply on “nn”.
75 76 77 |
# File 'lib/tomparse.rb', line 75 def sections @parser.sections end |
#signature_fields ⇒ Array
Do not use this in new code, and replace it when updating old code.
Presently this will always return an empty list. It will either be removed or renamed in future version.
A list of signature fields.
143 144 145 |
# File 'lib/tomparse.rb', line 143 def signature_fields @parser.signature_fields end |
#signatures ⇒ Array
A list of alternate method signatures.
133 134 135 |
# File 'lib/tomparse.rb', line 133 def signatures @parser.signatures end |
#tags ⇒ Array<Array<String>>
List of tags.
150 151 152 |
# File 'lib/tomparse.rb', line 150 def @parser. end |
#to_s ⇒ String
Raw documentation text.
37 38 39 |
# File 'lib/tomparse.rb', line 37 def to_s @parser.raw end |
#tomdoc ⇒ Object
The raw comment text cleaned-up and ready for section parsing.
68 69 70 |
# File 'lib/tomparse.rb', line 68 def tomdoc return @parser.tomdoc end |
#valid? ⇒ Boolean
Validate raw comment.
51 52 53 |
# File 'lib/tomparse.rb', line 51 def valid? @parser.valid? end |
#validate ⇒ Object
Validate raw comment.
59 60 61 |
# File 'lib/tomparse.rb', line 59 def validate @parser.validate end |
#yields ⇒ String
Description of a methods yield procedure.
112 113 114 |
# File 'lib/tomparse.rb', line 112 def yields @parser.yields end |