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 collapse

PATTERN =
/\A(?<details>.*?)?\Z/

Instance Attribute Summary

Attributes inherited from Tag

#directive

Attributes inherited from Node

#children

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tag

parse

Methods inherited from Node

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

Constructor Details

#initialize(directive) ⇒ Pragma

Returns a new instance of Pragma.



45
46
47
# File 'lib/decode/comment/pragma.rb', line 45

def initialize(directive)
	super(directive)
end

Class Method Details

.build(directive, match) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/decode/comment/pragma.rb', line 35

def self.build(directive, match)
	node = self.new(directive)
	
	if details = match[:details]
		node.add(Text.new(details))
	end
	
	return node
end