W
wbsurfver
I'm trying to get a handle on why the following code works by printing
out 'frog'
because @x looks like instance variable syntax. I know that some of
these things don't work the way I'd expect.
class Test
@x = 'frog'
class << self
attr_reader :x
end
end
puts Test.x
out 'frog'
because @x looks like instance variable syntax. I know that some of
these things don't work the way I'd expect.
class Test
@x = 'frog'
class << self
attr_reader :x
end
end
puts Test.x