I have a variable (result) that looks like this when doing YAML::dump(result):
responseHeader:
status: 0
QTime: 1
params:
wt: ruby
q: enid:(15542697739)
response:
numFound: 1
start: 0
docs:
- enid: "15542697739"
I want to do a conditional comparison on the enid like this:
if result["response"]["docs"]["enid"].to_i == num['1']['car']
where num['1']['car'] is an integer.
Whenever I attempt this, I get a TypeError thrown,
can't convert String into Integer
(TypeError)
even if I attempt
result["response"]["docs"]["enid"].to_i
or
Integer(result["response"]["docs"]["enid"])
How do I get my enid value converted to an integer so I can make this comparison?