Sha256: 7448ba017979b6fe7caac5ce209737bf69aa9a3c70f5d1e8f000804dd05098a7

Contents?: true

Size: 539 Bytes

Versions: 2

Compression:

Stored size: 539 Bytes

Contents

module Instagram
  module Response
    def self.create( response_hash, ratelimit_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

    attr_reader :pagination
    attr_reader :meta
    attr_reader :ratelimit
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
instagram-community-maintained-1.1.6 lib/instagram/response.rb
instagram-1.1.6 lib/instagram/response.rb