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

#The children of this node., #children

Instance Method Summary collapse

Methods inherited from Comment::Node

#add, #children?, #each, #filter, #text, #traverse

Constructor Details

#initialize(comments, language) ⇒ Documentation

Initialize the documentation with an array of comments, within a specific language.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/decode/documentation.rb', line 27

def initialize(comments, language)
	super(nil)
	
	@comments = comments
	@language = language
	
	if language
		language.tags.parse(@comments.dup) do |node|
			self.add(node)
		end
	end
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



41
42
43
# File 'lib/decode/documentation.rb', line 41

def comments
  @comments
end

#languageObject (readonly)

Returns the value of attribute language.



44
45
46
# File 'lib/decode/documentation.rb', line 44

def language
  @language
end

#The language in which the documentation was extracted from.(language) ⇒ Object (readonly)



44
# File 'lib/decode/documentation.rb', line 44

attr :language

#The underlying comments from which the documentation is extracted.(underlyingcommentsfromwhichthedocumentationisextracted.) ⇒ Object (readonly)



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

attr :comments