Class: YARD::Parser::Ruby::MethodCallNode
Managing node state
collapse
Instance Method Details
#block ⇒ Object
456
457
458
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 456
def block
last.type == :do_block || last.type == :brace_block ? last : nil
end
|
#block_param ⇒ Object
454
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 454
def block_param; parameters.last end
|
#call? ⇒ Boolean
431
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 431
def call?; true end
|
#method_name(name_only = false) ⇒ Object
434
435
436
437
438
439
440
441
442
443
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 434
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
432
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 432
def namespace; first if index_adjust > 0 end
|
#parameters(include_block_param = true) ⇒ Object
445
446
447
448
449
450
451
452
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 445
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
|