Method: RuboCop::AST::MethodDispatchNode#def_modifier?

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

#def_modifier?Boolean

Checks if this node is part of a chain of ‘def` modifiers.

Examples:


private def foo; end

Returns:

  • (Boolean)

    whether the dispatched method is a ‘def` modifier



150
151
152
153
# File 'lib/rubocop/ast/node/mixin/method_dispatch_node.rb', line 150

def def_modifier?
  send_type? &&
    [self, *each_descendant(:send)].any?(&:adjacent_def_modifier?)
end