Some remarks:
- You don't have to (and actually can't) always call methods with the
self
receiver. Private methods for example can only be called without an explicit receiver, so noself.
for private methods... - Why don't you inspect the url and check whether it is correct? Just add
puts url
after the line where you assign the url, run your program and check the output. Is the url correct? - You probably use HTTParty not correctly:
HTTParty.get('...')
returns a response object and you probably have to parse the response's body properly.
An example for a JSON service:
url = 'http://service.com/path/to/resource.json'
response = HTTParty.get url
data = JSON.parse(response.body)
# now you can use the data, e.g.
# bla = data['one']['foo']