1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Also passing block to response method missing so iteration and such work.

This commit is contained in:
John Nunemaker 2009-01-28 16:15:06 -05:00
parent 4790c8789d
commit d98f21c3f7
2 changed files with 8 additions and 3 deletions

View file

@ -3,4 +3,9 @@ require File.join(dir, 'httparty')
require 'pp'
# You can also use post, put, delete in the same fashion
pp HTTParty.get('http://twitter.com/statuses/public_timeline.json')
response = HTTParty.get('http://twitter.com/statuses/public_timeline.json')
pp response
response.each do |item|
puts item['user']['screen_name']
end

View file

@ -8,8 +8,8 @@ module HTTParty
@code = code
end
def method_missing(name, *args)
@delegate.send(name, *args)
def method_missing(name, *args, &block)
@delegate.send(name, *args, &block)
end
def ==(other)