You're thinking about this the wrong way around. While it may be possible to do this in Ruby, it would be overly complicated. The proper way to do this would be:
val.change_me!
Which, of course, varies depending on the class of what you want to change. The point is that, by convention, the methods with '!' affect the class instance on which they're called.
So...
class Changeable
def initialize var
@var = var
end
def change_me! change
change ||= 1
@var += change
end
end
a = Changeable.new 5 # => New object "Changeable", value 5
a.change_me! 6 # => @var = 7
a.change_me! # => @var = 8
Hope this helps a bit..