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



112
113
114
115
# File 'lib/ruby-next/rubocop.rb', line 112

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

#on_defs_e(node) ⇒ Object



117
118
119
120
# File 'lib/ruby-next/rubocop.rb', line 117

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



95
96
97
# File 'lib/ruby-next/rubocop.rb', line 95

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

#on_numblock(node) ⇒ Object



100
101
102
103
104
105
106
107
108
# File 'lib/ruby-next/rubocop.rb', line 100

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