Method: RuboCop::AST::MethodDispatchNode#command?

Defined in:
lib/rubocop/ast/node/mixin/method_dispatch_node.rb

#command?(name) ⇒ Boolean

Checks whether the name of the dispatched method matches the argument and has an implicit receiver.

Parameters:

  • name (Symbol, String)

    the method name to check for

Returns:

  • (Boolean)

    whether the method name matches the argument



73
74
75
# File 'lib/rubocop/ast/node/mixin/method_dispatch_node.rb', line 73

def command?(name)
  !receiver && method?(name)
end