Firstly - class variables are evil and should be avoided (because they are also inherited by all subclasses and usually causes more harm than good.
You want to create a class instance variable (not class variable) on a class or module which is including given module. It is easy to do with included
method:
module Foo
@default_settings = {}
module ClassMethods
def foo_settings
@foo_settings
end
end
def self.included(target)
target.instance_variable_set('@foo_settings', @default_settings.dup)
target.extend ClassMethods
end
end