K
Kyung won Cheon
class A
WHY = "I don't know why!!"
def self.foo
WHY
end
end
puts A.instance_eval("foo") # => I don't know why!!
puts A.instance_eval("WHY") # => uninitialized constant Class::WHY
(NameError)
# What's difference?
# Help Me^^
WHY = "I don't know why!!"
def self.foo
WHY
end
end
puts A.instance_eval("foo") # => I don't know why!!
puts A.instance_eval("WHY") # => uninitialized constant Class::WHY
(NameError)
# What's difference?
# Help Me^^