I have ClassA
that includes several modules
class ClassA
include Module1
include Module2
def initialize()
@some_var = ...
end
end
Included modules have methods that use instance variable @some_var
module Module1
def method1
@some_var.a()
end
end
module Module2
def method2
@some_var.b()
end
end
The code below works fine and is correct
obj = ClassA.new
obj.method1
obj.method2
But I don't know if it is correct to use an instance variable in included modules. Maybe I need to implement another architecture.