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, #text, #traverse
Constructor Details
#initialize(comments, language = nil) ⇒ Documentation
Initialize the documentation with an array of comments, within a specific language.
38 39 40 41 42 43 44 45 |
# File 'lib/decode/documentation.rb', line 38 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.
49 50 51 |
# File 'lib/decode/documentation.rb', line 49 def comments @comments end |
#language ⇒ Object (readonly)
The language in which the documentation was extracted from.
53 54 55 |
# File 'lib/decode/documentation.rb', line 53 def language @language end |