Ruby - Class Methods and Variables
What will this Ruby code print?
class Example
@value = 5
def self.value
@value
end
end
puts Example.valueclass Example
@value = 5
def self.value
@value
end
end
puts Example.value15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions