class YARD::Parser::Ruby::MethodCallNode
Public Instance Methods
Source
# File lib/yard/parser/ruby/ast_node.rb, line 464 def block last.type == :do_block || last.type == :brace_block ? last : nil end
Source
# File lib/yard/parser/ruby/ast_node.rb, line 462 def block_param; parameters.last end
Source
# File lib/yard/parser/ruby/ast_node.rb, line 442 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
Source
# File lib/yard/parser/ruby/ast_node.rb, line 440 def namespace; first if index_adjust > 0 end
Source
# File lib/yard/parser/ruby/ast_node.rb, line 453 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
Private Instance Methods
Source
# File lib/yard/parser/ruby/ast_node.rb, line 474 def call_has_paren? [:fcall, :call].include?(type) end
Source
# File lib/yard/parser/ruby/ast_node.rb, line 470 def index_adjust [:call, :command_call].include?(type) ? 2 : 0 end