Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Fix "can't modify frozen NilClass".
Browse files Browse the repository at this point in the history
  • Loading branch information
klacointe committed Jan 28, 2015
1 parent b6c73c1 commit 32d0972
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/instagram/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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)
%w{pagination meta}.each do |k|
response_hash.public_send(k).tap do |v|
instance_variable_set("@#{k}", v) if v
end
end
ratelimit = ::Hashie::Mash.new(ratelimit_hash)
end
data
end
Expand Down

0 comments on commit 32d0972

Please sign in to comment.