N
Nicholas Wieland
Hi *,
module Included
def whatever
do_something_with FOO
end
end
module Includer
include Included
class Whatever
FOO = 'whatever'
end
end
this is not just an example to invent stupid variable names, but a
question.
I would like to include the Included module and have visibility on the
Includer module constants (think about validation, different classes
need different data).
Can you suggest me a way to accomplish that, to have a method inside a
module that checks data inside a class in another module, and define
the rules in the class itself ?
"You're an idiot you should do like that" answers are welcome
ngw
module Included
def whatever
do_something_with FOO
end
end
module Includer
include Included
class Whatever
FOO = 'whatever'
end
end
this is not just an example to invent stupid variable names, but a
question.
I would like to include the Included module and have visibility on the
Includer module constants (think about validation, different classes
need different data).
Can you suggest me a way to accomplish that, to have a method inside a
module that checks data inside a class in another module, and define
the rules in the class itself ?
"You're an idiot you should do like that" answers are welcome
ngw