Reputation: 681
This question is regarding programming practices in Ruby.
Is it preferable to create instance variables in ruby inside a static method? Or should they be created in an initialize
method?
Upvotes: 0
Views: 262
Reputation: 26385
Well initialize is made for that, why would you do something different.
class SomeClass
def initialize(first, second)
@first = first
@second = second
end
end
Upvotes: 1