7/20 - Is here two or one $ must be?


#1

I wrote code this way and it pass OK.

class MyClass
my_variable = "Hello!"
end

puts $my_variable

But Hint says it must be

class MyClass
$my_variable = "Hello!"
end

puts $my_variable

Which way is proper?


#2

Your first code shouldn't pass.

The seconde one is correct.


#3

hmmm... it still works in my lesson...


#4
Imgur