Class: YARD::Parser::Ruby::ParameterNode
Constant Summary
Instance Attribute Summary (collapse)
-
- (Object) docstring
(also: #comments)
inherited
from AstNode
Returns the value of attribute docstring.
-
- (Object) docstring_hash_flag
(also: #comments_hash_flag)
inherited
from AstNode
Returns the value of attribute docstring_hash_flag.
-
- (Object) docstring_range
(also: #comments_range)
inherited
from AstNode
Returns the value of attribute docstring_range.
-
- (String) file
inherited
from AstNode
The filename the node was parsed from.
-
- (String) full_source
inherited
from AstNode
The full source that the node was parsed from.
-
- (Object) group
inherited
from AstNode
deprecated
Deprecated.
Groups are now defined by directives
-
- (Range) line_range
inherited
from AstNode
The line range in AstNode#full_source represented by the node.
-
- (AstNode?) parent
inherited
from AstNode
The node's parent or nil if it is a root node.
-
- (String) source
inherited
from AstNode
The parse of AstNode#full_source that the node represents.
-
- (Range) source_range
inherited
from AstNode
The character range in AstNode#full_source represented by the node.
-
- (Symbol) type
inherited
from AstNode
The node's unique symbolic type.
Managing node state (collapse)
- - (Object) block_param
- - (Object) keyword_param
- - (Object) optional_params
- - (Object) required_end_params
- - (Object) required_params
- - (Object) splat_param
Constructor Details
This class inherits a constructor from YARD::Parser::Ruby::AstNode
Instance Attribute Details
- (Object) docstring Also known as: comments Originally defined in class AstNode
Returns the value of attribute docstring
- (Object) docstring_hash_flag Also known as: comments_hash_flag Originally defined in class AstNode
Returns the value of attribute docstring_hash_flag
- (Object) docstring_range Also known as: comments_range Originally defined in class AstNode
Returns the value of attribute docstring_range
- (String) full_source Originally defined in class AstNode
Returns the full source that the node was parsed from
- (Object) group Originally defined in class AstNode
Groups are now defined by directives
- (Range) line_range Originally defined in class AstNode
Returns the line range in #full_source represented by the node
- (AstNode?) parent Originally defined in class AstNode
Returns the node's parent or nil if it is a root node.
- (String) source Originally defined in class AstNode
Returns the parse of #full_source that the node represents
- (Range) source_range Originally defined in class AstNode
Returns the character range in #full_source represented by the node
- (Symbol) type Originally defined in class AstNode
Returns the node's unique symbolic type
Instance Method Details
- (Object) block_param
382 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 382 def block_param; self[-1] ? self[-1][0] : nil end |
- (Object) keyword_param
390 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 390 def keyword_param; YARD.ruby2? ? self[-2] : nil end |
- (Object) optional_params
383 384 385 386 387 388 389 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 383 def optional_params optional = self[1] || [] if self[-3] && self[-3][0] && self[-3][0].type == :default_arg optional += self[-3] end optional.empty? ? nil : optional end |
- (Object) required_end_params
380 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 380 def required_end_params; self[3] end |
- (Object) required_params
379 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 379 def required_params; self[0] end |
- (Object) splat_param
381 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 381 def splat_param; self[2] ? self[2][0] : nil end |