Hi

I am working on application that emphasizes on the data types of the
data. The application reads a line from the user by the prompt. then it
divides the entry into parts based on comma separator.
e.g

f = gets
<user input> "apple", 5, 8.9, "red"

after i split them in an array

arr = f.split(", ")

they will be all converted into string and stored in arr as elements of
array.
I need to check whether the type of 5 is integer or not, 8.9 is float,
etc. In this case it is fine  but in the case that the user keys in
string instead of float. the methods to_i, to_f will convert the string
into 0 and assume it is of that type.

Is there any mechanism that allows me to check the data type ?

Regards
Shuaib
-- 
Posted via http://www.ruby-forum.com/.