M
Marcin Tyman
Hi guys!!!
My question is:
Is any way to define variables in module which can be further used in
mixin? The problem is that module I wanted to include into class has
constant variables defined which are used within function it implements.
I'm looking for simplest way to overwrite the variables from the class
(may change the variables to non constant ones) the same meaning not to
change implementation of functions from the module. See:
module Mod
AnyVar = 10
def func
#the method use AnyVar
end
end
class MyClass
include Mod
def initialize
#read configuration
#how to make the function use new AnyVar value without changing its
implementation and parameters list
func()
end
end
Thanks a lot for any ideas.
My question is:
Is any way to define variables in module which can be further used in
mixin? The problem is that module I wanted to include into class has
constant variables defined which are used within function it implements.
I'm looking for simplest way to overwrite the variables from the class
(may change the variables to non constant ones) the same meaning not to
change implementation of functions from the module. See:
module Mod
AnyVar = 10
def func
#the method use AnyVar
end
end
class MyClass
include Mod
def initialize
#read configuration
#how to make the function use new AnyVar value without changing its
implementation and parameters list
func()
end
end
Thanks a lot for any ideas.