Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't convert String into Integer #35

Open
acidtib opened this issue Apr 11, 2012 · 3 comments
Open

can't convert String into Integer #35

acidtib opened this issue Apr 11, 2012 · 3 comments

Comments

@acidtib
Copy link

acidtib commented Apr 11, 2012

im using Vimeo::Simple::Video.info("video_id") and i keep getting the following error

can't convert String into Integer

@prelocator
Copy link

I have the same problem
TypeError: can't convert String into Integer
from /usr/local/lib/ruby/gems/1.8/gems/httparty-0.9.0/lib/httparty/response.rb:52:in []' from /usr/local/lib/ruby/gems/1.8/gems/httparty-0.9.0/lib/httparty/response.rb:52:insend'
from /usr/local/lib/ruby/gems/1.8/gems/httparty-0.9.0/lib/httparty/response.rb:52:in `method_missing'
from (irb):4
Any suggestion?

@neilsmind
Copy link

Had the same issue but believe that I've resolved it. I was trying to get info for a video like so:
video = Vimeo::Simple::Video.info(video_id)

Then I was trying to get the thumbnail image:
video["thumbnail_medium"]

What received instead of my thumbnail url was an error like those listed:
TypeError: can't convert String into Integer

The reason? The .info method returns an array of videos (albeit with just one item in the array). Therefore, what I needed to get was the thumbnail_medium of the first item in the array:
video[0]["thumbnail_medium"]

Hope that helps anyone else having a problem.

@prelocator
Copy link

working perfectly, thank you so much neilsmind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants