Class: RuboCop::Cop::SketchupPerformance::Typename
- Inherits:
-
SketchUp::Cop
- Object
- SketchUp::WorkaroundCop
- SketchUp::Cop
- RuboCop::Cop::SketchupPerformance::Typename
- Defined in:
- lib/rubocop/sketchup/cop/performance/typename.rb
Constant Summary collapse
- MSG =
'`.typename` is very slow, prefer `.is_a?` instead.'.freeze
Constants included from SketchUp::Config
SketchUp::Config::DEFAULT_CONFIGURATION
Instance Method Summary collapse
Methods inherited from SketchUp::Cop
Instance Method Details
#on_send(node) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/rubocop/sketchup/cop/performance/typename.rb', line 9 def on_send(node) _, method_name = *node return unless method_name == :typename # TODO(thomthom): Should we try to detect use of #typename # in context of comparing against a string? add_offense(node, location: :expression) end |