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:
parent
4790c8789d
commit
d98f21c3f7
2 changed files with 8 additions and 3 deletions
|
@ -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
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue