module Instagram::Response

Attributes

meta[R]
pagination[R]
ratelimit[R]

Public Class Methods

create( response_hash, ratelimit_hash ) click to toggle source
# File lib/instagram/response.rb, line 3
def self.create( response_hash, ratelimit_hash )
  response_hash = {} unless response_hash
  data = response_hash.data.dup rescue response_hash
  data.extend( self )
  data.instance_exec do
    %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