Class: CustomCops::Constantize
- Inherits:
-
RuboCop::Cop::Base
- Object
- RuboCop::Cop::Base
- CustomCops::Constantize
- Defined in:
- lib/simplycop/custom_cops/constantize.rb
Overview
This cop checks for the presence of dynamically generated constants
Constant Summary collapse
- MSG =
'Avoid dynamically creating constants.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
18 19 20 21 22 |
# File 'lib/simplycop/custom_cops/constantize.rb', line 18 def on_send(node) return unless constantizing?(node) add_offense(node.loc.selector) end |