class Foo
@@default = "default"
p instance_variables
p class_variables
class << self
p instance_variables
p class_variables
# How do I access the @@default variable here?
end
end
The same way you do it in any other place: @@default
.
I'm not sure what p ..
is supposed to do (Ruby isn't my native language), but this works
class Foo
@@default = "default"
class << self
puts "#{@@default}"
end
end