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

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

Constant Summary

Constants inherited from AstNode

AstNode::KEYWORDS

Instance Attribute Summary

Attributes inherited from AstNode

#docstring, #docstring_range, #file, #full_source, #group, #line_range, #parent, #source, #source_range, #type

Printing a Node collapse

Methods inherited from AstNode

#children, #condition?, #first_line, #has_line?, #initialize, #inspect, #jump, #kw?, #line, #literal?, node_class_for, #pretty_print, #ref?, #show, #to_s, #token?, #traverse

Methods inherited from Array

#place

Constructor Details

This class inherits a constructor from YARD::Parser::Ruby::AstNode

Instance Method Details

#block_paramObject



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

def block_param; parameters.last end

#call?Boolean

Returns:

  • (Boolean)


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

def call?; true end

#method_name(name_only = false) ⇒ Object



342
343
344
345
# File 'lib/yard/parser/ruby/ast_node.rb', line 342

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

#namespaceObject



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

def namespace; first if index_adjust > 0 end

#parameters(include_block_param = true) ⇒ Object



347
348
349
350
351
352
# File 'lib/yard/parser/ruby/ast_node.rb', line 347

def parameters(include_block_param = true)
  params = self[1 + index_adjust]
  return nil unless params
  params = call_has_paren? ? params.first : params
  include_block_param ? params : params[0...-1]
end