title: Using Instance Variables in Class Methods - Ruby
body: <p>I have a class something like below, and I used instance variables (array) to avoid using lots of method parameters. </p>
  
  <p>It works as I expected but is that a good practice?
  Actually I wouldn't expect that worked, but I guess class methods are not working as static methods in other languages.</p>
  
  <pre><code>class DummyClass
    def self.dummy_method1
      @arr = []
      # Play with that array
    end
  
    def self.dummy_method2
      # use @arr for something else
    end
  end
  </code></pre>