Here's the code:
class Something
attr_accessor :x
def initialize(x)
@x = x
end
def get_x
x
end
end
something = Something.new(5)
something.get_x # => 5
Why interpreter returns 5 if x is just a local variable in get_x method? Thanks