RosettaCodeData/Task/Address-of-a-variable/Ruby/address-of-a-variable.rb
2013-04-10 14:58:50 -07:00

3 lines
119 B
Ruby

>foo = Object.new # => #<Object:0x10ae32000>
>id = foo.object_id # => 2238812160
>"%x" % (id << 1) # => "10ae32000"