Class: Decode::Comment::Pragma

Inherits:
Tag
  • Object
show all
Defined in:
lib/decode/comment/pragma.rb

Overview

Asserts a specific property about the method signature.

  • ‘@reentrant This method is thread-safe.`

  • ‘@deprecated Please use other_method instead.`

  • ‘@blocking This method may block.`

  • ‘@asynchronous This method may yield.`

Constant Summary

Constants inherited from Tag

Tag::PATTERN

Instance Attribute Summary

Attributes inherited from Tag

#The directive that generated the tag., #directive

Attributes inherited from Node

#The children of this node., #children

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tag

bracketed_content, match

Methods inherited from Node

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

Constructor Details

#initialize(directive) ⇒ Pragma

Initialize a new pragma.



43
44
45
# File 'lib/decode/comment/pragma.rb', line 43

def initialize(directive)
	super(directive)
end

Class Method Details

.build(directive, text) ⇒ Object

Build a pragma from a directive and text.



31
32
33
34
35
36
37
38
39
# File 'lib/decode/comment/pragma.rb', line 31

def self.build(directive, text)
	node = self.new(directive)
	
	if text
		node.add(Text.new(text))
	end
	
	return node
end

.parse(directive, text, lines, tags, level = 0) ⇒ Object

Parse a pragma directive from text.



24
25
26
# File 'lib/decode/comment/pragma.rb', line 24

def self.parse(directive, text, lines, tags, level = 0)
	self.build(directive, text)
end