Class: YARD::Parser::Ruby::MethodCallNode
- Defined in:
- lib/yard/parser/ruby/ast_node.rb
Constant Summary
Instance Attribute Summary collapse
-
#docstring ⇒ Object
(also: #comments)
inherited
from AstNode
Returns the value of attribute docstring.
-
#docstring_hash_flag ⇒ Object
(also: #comments_hash_flag)
inherited
from AstNode
Returns the value of attribute docstring_hash_flag.
-
#docstring_range ⇒ Object
(also: #comments_range)
inherited
from AstNode
Returns the value of attribute docstring_range.
-
#file ⇒ String
inherited
from AstNode
The filename the node was parsed from.
-
#full_source ⇒ String
inherited
from AstNode
The full source that the node was parsed from.
-
#group ⇒ Object
inherited
from AstNode
deprecated
Deprecated.
Groups are now defined by directives
-
#line_range ⇒ Range
inherited
from AstNode
The line range in AstNode#full_source represented by the node.
-
#parent ⇒ AstNode?
inherited
from AstNode
The node's parent or nil if it is a root node.
-
#source ⇒ String
inherited
from AstNode
The parse of AstNode#full_source that the node represents.
-
#source_range ⇒ Range
inherited
from AstNode
The character range in AstNode#full_source represented by the node.
-
#type ⇒ Symbol
inherited
from AstNode
The node's unique symbolic type.
Managing node state collapse
- #block ⇒ Object
- #block_param ⇒ Object
- #call? ⇒ Boolean
- #method_name(name_only = false) ⇒ Object
- #namespace ⇒ Object
- #parameters(include_block_param = true) ⇒ Object
Constructor Details
This class inherits a constructor from YARD::Parser::Ruby::AstNode
Instance Attribute Details
#docstring ⇒ Object Also known as: comments Originally defined in class AstNode
Returns the value of attribute docstring
#docstring_hash_flag ⇒ Object Also known as: comments_hash_flag Originally defined in class AstNode
Returns the value of attribute docstring_hash_flag
#docstring_range ⇒ Object Also known as: comments_range Originally defined in class AstNode
Returns the value of attribute docstring_range
#full_source ⇒ String Originally defined in class AstNode
Returns the full source that the node was parsed from
#group ⇒ Object Originally defined in class AstNode
Groups are now defined by directives
#line_range ⇒ Range Originally defined in class AstNode
Returns the line range in #full_source represented by the node
#parent ⇒ AstNode? Originally defined in class AstNode
Returns the node's parent or nil if it is a root node.
#source ⇒ String Originally defined in class AstNode
Returns the parse of #full_source that the node represents
#source_range ⇒ Range Originally defined in class AstNode
Returns the character range in #full_source represented by the node
#type ⇒ Symbol Originally defined in class AstNode
Returns the node's unique symbolic type
Instance Method Details
#block ⇒ Object
446 447 448 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 446 def block last.type == :do_block || last.type == :brace_block ? last : nil end |
#block_param ⇒ Object
445 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 445 def block_param; parameters.last end |
#call? ⇒ Boolean
422 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 422 def call?; true end |
#method_name(name_only = false) ⇒ Object
425 426 427 428 429 430 431 432 433 434 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 425 def method_name(name_only = false) name = self[index_adjust] if name == :call nil elsif name_only && Array === name name.jump(:ident).first.to_sym else name end end |
#namespace ⇒ Object
423 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 423 def namespace; first if index_adjust > 0 end |
#parameters(include_block_param = true) ⇒ Object
436 437 438 439 440 441 442 443 |
# File 'lib/yard/parser/ruby/ast_node.rb', line 436 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 |