Class: YARD::Parser::Ruby::MethodCallNode

Inherits:
AstNode show all
Defined in:
lib/yard/parser/ruby/ast_node.rb

Constant Summary

Instance Attribute Summary (collapse)

Managing node state (collapse)

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) file Originally defined in class AstNode

Returns the filename the node was parsed from

Returns:

  • (String)

    the filename the node was parsed from

- (String) full_source Originally defined in class AstNode

Returns the full source that the node was parsed from

Returns:

  • (String)

    the full source that the node was parsed from

- (Object) group Originally defined in class AstNode

Deprecated.

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

Returns:

  • (Range)

    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.

Returns:

  • (AstNode, nil)

    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

Returns:

- (Range) source_range Originally defined in class AstNode

Returns the character range in #full_source represented by the node

Returns:

  • (Range)

    the character range in #full_source represented by the node

- (Symbol) type Originally defined in class AstNode

Returns the node's unique symbolic type

Returns:

  • (Symbol)

    the node's unique symbolic type

Instance Method Details

- (Object) block



412
413
414
# File 'lib/yard/parser/ruby/ast_node.rb', line 412

def block
  last.type == :do_block || last.type == :brace_block ? last : nil
end

- (Object) block_param



411
# File 'lib/yard/parser/ruby/ast_node.rb', line 411

def block_param; parameters.last end

- (Boolean) call?

Returns:

  • (Boolean)


394
# File 'lib/yard/parser/ruby/ast_node.rb', line 394

def call?; true end

- (Object) method_name(name_only = false)



397
398
399
400
# File 'lib/yard/parser/ruby/ast_node.rb', line 397

def method_name(name_only = false)
  name = self[index_adjust]
  name_only ? name.jump(:ident).first.to_sym : name
end

- (Object) namespace



395
# File 'lib/yard/parser/ruby/ast_node.rb', line 395

def namespace; first if index_adjust > 0 end

- (Object) parameters(include_block_param = true)



402
403
404
405
406
407
408
409
# File 'lib/yard/parser/ruby/ast_node.rb', line 402

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