irb(main):006:0> x << "a"
"You entered a"
"nope: i'm sorry, only integers allowed"

--------

and what if an user does x[2] = "i'm an integer :)"



-- 
>here are more things in heaven and earth,
horatio, than are dreamt of in your philosophy.