forked from haonature/instagram-ruby-gem
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request facebookarchive#139 from wishpond-dev/master
Ratelimit support for responses from Instagram
- Loading branch information
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
module Instagram | ||
module Response | ||
def self.create( response_hash ) | ||
def self.create( response_hash, ratelimit_hash ) | ||
data = response_hash.data.dup rescue response_hash | ||
data.extend( self ) | ||
data.instance_exec do | ||
@pagination = response_hash.pagination | ||
@meta = response_hash.meta | ||
@ratelimit = ::Hashie::Mash.new(ratelimit_hash) | ||
end | ||
data | ||
end | ||
|
||
attr_reader :pagination | ||
attr_reader :meta | ||
attr_reader :ratelimit | ||
end | ||
end |