Class: RuboCop::Cop::Commissioner

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-next/rubocop.rb

Overview

Commissioner class is responsible for processing the AST and delegating work to the specified cops.

Instance Method Summary collapse

Instance Method Details

#on_def_e(node) ⇒ Object



97
98
99
100
# File 'lib/ruby-next/rubocop.rb', line 97

def on_def_e(node)
  _name, _args_node, body_node = *node
  send(:"on_#{body_node.type}", body_node)
end

#on_defs_e(node) ⇒ Object



102
103
104
105
# File 'lib/ruby-next/rubocop.rb', line 102

def on_defs_e(node)
  _definee_node, _name, _args_node, body_node = *node
  send(:"on_#{body_node.type}", body_node)
end

#on_meth_ref(node) ⇒ Object



80
81
82
# File 'lib/ruby-next/rubocop.rb', line 80

def on_meth_ref(node)
  trigger_responding_cops(:on_meth_ref, node)
end

#on_numblock(node) ⇒ Object



85
86
87
88
89
90
91
92
93
# File 'lib/ruby-next/rubocop.rb', line 85

def on_numblock(node)
  children = node.children
  child = children[0]
  send(:"on_#{child.type}", child)
  # children[1] is the number of parameters
  return unless (child = children[2])

  send(:"on_#{child.type}", child)
end