:
class Variable
def initialize value = nil
@value = value
end
attr_accessor :value
def method_missing *args, &blk
@value.send(*args, &blk)
end
def to_s
@value.to_s
end
def inc x = 1
@value += x
end
def dec x = 1
@value -= x
end
end
x = Variable.new 1
puts x
puts x.object_id
x.inc
puts x
puts x.object_id
x.inc 3
puts x
puts x.object_id
" " .