Is there any way to create a variable in a module in Ruby that would behave similar to a class variable? What I mean by this is that it would be able to be accessed without
You can also initialize value within module definition:
module MyModule class << self attr_accessor :my_variable end self.my_variable = 2 + 2 end p MyModule.my_variable