ameba
ameba copied to clipboard
[Feature Request] Lint against accessing instance variables outside of the instance of a class
It's possible to access instance variables on an instance of a class similarly to instance_variable_get
in Ruby
class MyKlass
def initialize(@my_instance_var : String); end
end
puts MyKlass.new("hello").@my_instance_var
# => "hello"
This can be handy for debugging purposes but I think generally should be discouraged as I think it's commonly expected that instance variables are private to the instance of a class.