Class: Decode::Documentation

Inherits:
Comment::Node show all
Defined in:
lib/decode/documentation.rb

Overview

Structured access to a set of comment lines.

Instance Attribute Summary collapse

Attributes inherited from Comment::Node

#children

Instance Method Summary collapse

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.tags.parse(@comments.dup) do |node|
		self.add(node)
	end
end

Instance Attribute Details

#commentsObject (readonly)

The underlying comments from which the documentation is extracted.



35
36
37
# File 'lib/decode/documentation.rb', line 35

def comments
  @comments
end

#languageObject (readonly)

The language in which the documentation was extracted from.



39
40
41
# File 'lib/decode/documentation.rb', line 39

def language
  @language
end