Class: RuboCop::Cop::Airbnb::FactoryClassUseString
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Airbnb::FactoryClassUseString
- Defined in:
- lib/rubocop/cop/airbnb/factory_class_use_string.rb
Overview
Cop to tell developers to use :class => “MyClass” instead of :class => MyClass, because the latter slows down reloading zeus.
Constant Summary collapse
- MSG =
'Instead of :class => MyClass, use :class => "MyClass". ' \ "This enables faster spec startup time and faster Zeus reload time.".freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/rubocop/cop/airbnb/factory_class_use_string.rb', line 10 def on_send(node) return unless node.command?(:factory) class_pair = class_node(node) if class_pair && !string_class_name?(class_pair) add_offense(class_pair) end end |