I have a constructor for an object Program that validates an argument to make sure it is an integer:
def initialize(programid,*other_args)
unless programid.is_a?(Integer) then
raise TypeError
end
@programid = programid
@name = other_args['name']
end
and when I create a new instance
my_prog = Program::new(13453)
It gives me this error:
can't convert String into Integer (TypeError)
Which should not be happening because I'm not trying to do a conversion. Any ideas?