I'm trying to create a class that includes the Singleton module while using attr_accessor. This doesn't seem to be working though.
require 'singleton'
class Foo
attr_accessor :bar
include Singleton
end
Foo.bar = 'foobar'
This gives the error:
undefined method `bar=' for Foo:Class (NoMethodError)
What am I doing wrong here?