We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ThreadSafety/InstanceVariableInClassMethod rule fires when assigning an anonymous class's instance variable.
class Outer def self.create_anonymous_class Class.new do def initialize @anonymous_variable = 'hi' end end end end
No errors.
Inspecting 1 file C Offenses: test.rb:7:9: C: ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods. @anonymous_variable = 'hi' ^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
ThreadSafety/InstanceVariableInClassMethod rule fires when assigning an anonymous class's instance variable.
Example file
Expected
No errors.
Actual
The text was updated successfully, but these errors were encountered: