Class: Decode::Documentation
- Inherits:
-
Comment::Node
- Object
- Comment::Node
- Decode::Documentation
- Defined in:
- lib/decode/documentation.rb
Overview
Structured access to a set of comment lines.
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
The underlying comments from which the documentation is extracted.
-
#language ⇒ Object
readonly
The language in which the documentation was extracted from.
Attributes inherited from Comment::Node
Instance Method Summary collapse
-
#initialize(comments, language = nil) ⇒ Documentation
constructor
Initialize the documentation with an array of comments, within a specific language.
Methods inherited from Comment::Node
#add, #children?, #each, #filter, #text, #traverse
Constructor Details
#initialize(comments, language = nil) ⇒ Documentation
Initialize the documentation with an array of comments, within a specific language.
24 25 26 27 28 29 30 31 |
# File 'lib/decode/documentation.rb', line 24 def initialize(comments, language = nil) @comments = comments @language = language language..parse(@comments.dup) do |node| self.add(node) end end |
Instance Attribute Details
#comments ⇒ Object (readonly)
The underlying comments from which the documentation is extracted.
35 36 37 |
# File 'lib/decode/documentation.rb', line 35 def comments @comments end |
#language ⇒ Object (readonly)
The language in which the documentation was extracted from.
39 40 41 |
# File 'lib/decode/documentation.rb', line 39 def language @language end |