Please help me out.
I need to use the same bunch of attributes in many classes. I would suggest to create module with predefined attributes and extend this module in every class
module Basic
@a=10
end
class Use
extend Basic
def self.sh
@a
end
end
puts Use.sh
but the output is empty. It seems like I missed something.
Maybe there is a better way to do that?
Your thoughts?
It’s all about the
self:has
selfevaluating to Basic. You want it to evaluate toUsewhen the latter is extended: