Class: YARD::Parser::Ruby::MethodCallNode
Managing node state
collapse
Instance Method Details
#block ⇒ Object
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
|
#block_param ⇒ Object
411
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 411
def block_param; parameters.last end
|
#call? ⇒ Boolean
394
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 394
def call?; true end
|
#method_name(name_only = false) ⇒ Object
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
|
#namespace ⇒ Object
395
|
# File 'lib/yard/parser/ruby/ast_node.rb', line 395
def namespace; first if index_adjust > 0 end
|
#parameters(include_block_param = true) ⇒ Object
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
|