Class: YARD::Parser::Ruby::MethodCallNode
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
- - (Object) block_param
- - (Boolean) call?
- - (Object) method_name(name_only = false)
- - (Object) namespace
- - (Object) parameters(include_block_param = true)
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
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
The line range in #full_source represented by the node
- (AstNode?) parent Originally defined in class AstNode
The node's parent or nil if it is a root node.
- (String) source Originally defined in class AstNode
The parse of #full_source that the node represents
- (Range) source_range Originally defined in class AstNode
The character range in #full_source represented by the node
- (Symbol) type Originally defined in class AstNode
The node's unique symbolic type
Instance Method Details
- (Object) block
405 406 407 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 405 def block last.type == :do_block || last.type == :brace_block ? last : nil end |
- (Object) block_param
404 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 404 def block_param; parameters.last end |
- (Boolean) call?
387 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 387 def call?; true end |
- (Object) method_name(name_only = false)
390 391 392 393 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 390 def method_name(name_only = false) name = self[index_adjust] name_only ? name.jump(:ident).first.to_sym : name end |
- (Object) namespace
388 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 388 def namespace; first if index_adjust > 0 end |
- (Object) parameters(include_block_param = true)
395 396 397 398 399 400 401 402 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 395 def parameters(include_block_param = true) return [] if type == :vcall params = self[1 + index_adjust] return [] unless params params = call_has_paren? ? params.first : params return [] unless params include_block_param ? params : params[0...-1] end |