I have a Module with a constant and variable.
I wonder how I could include these in a class?
module Software
VAR = 'hejsan'
def exit
@text = "exited"
puts @text
end
end
class Windows
extend Software
def self.start
exit
puts VAR
puts @text
end
end
Windows.start
Is this possible?
Doing exactly what you want is not possible. Instance variables are strictly per object.
This happens to do what you expect, but
@textis set onWindowsnotSoftware.