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

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

Constant Summary

Constants inherited from AstNode

KEYWORDS

Instance Method Summary

Methods inherited from AstNode

#==, #children, #comments, #comments_range, #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

- (Object) block_param



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

def block_param; parameters.last end

- (Boolean) call?

Returns:

  • (Boolean)


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

def call?; true end

- (Object) method_name(name_only = false)



323
324
325
326
# File 'lib/yard/parser/ruby/ast_node.rb', line 323

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

- (Object) namespace



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

def namespace; first if index_adjust > 0 end

- (Object) parameters(include_block_param = true)



328
329
330
331
332
333
# File 'lib/yard/parser/ruby/ast_node.rb', line 328

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