I have I have a cgi script written in eruby. I have turned cgi.param into a
hash object ‘p’
One of these parameters I need to use as an integer. It turns out this
parameter’s type is Array (?!?) and not a string like I thought.
i = p[‘count’].to_s.to_i
As you can see, I was able to turn this thing into an integer finally, but
it leaves me with two questions:
- Is there a prettier way to do what I am trying to do above?
- Why is it an Array, when I thought it would be a key -> value, where
value is a string
P.S. What the heck,
2) What would be the situation where you would want it to be an Array?