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

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

Managing node state collapse

Constructor Details

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

Instance Method Details

#blockObject



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

#block_paramObject



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

def block_param; parameters.last end

#call?Boolean

Returns:

  • (Boolean)


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

def call?; true end

#method_name(name_only = false) ⇒ Object



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

#namespaceObject



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

def namespace; first if index_adjust > 0 end

#parameters(include_block_param = true) ⇒ Object



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