I was certain I had done this sort of thing before – can someone
tell me what’s going on?
I’m up much too early – likely a short circuit between my ears.
Basically – Baz acts as I want/expect, and Foo does not.
Why??
Thanks,
Hal
class Foo
class << self
attr_accessor :bar
Foo.bar = “hello”
end
def initialize
puts “Foo: #{Foo.bar.inspect}”
end
end
class Baz
class << self
attr_accessor :bar
@bar = “hello”
end
def initialize
puts “Baz: #{Baz.bar.inspect}”
end
end
Foo.new
Baz.new