I'm trying to create a class, which has a constructor that takes a single argument. When I create a new instance of the object, it returns a pointer.
class Adder
def initialize(my_num)
@my_num = my_num
end
end
y = Adder.new(12)
puts y
What am I doing wrong? Thanks
question from:https://stackoverflow.com/questions/8125946/ruby-object-prints-out-as-pointer