Sha256: 50f14f5a2c09f7cf4c23a426cc26f684287c99cf777c4ff3cdb5d396593abaa3

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 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 & 1 rubygems

Version Path
instagram-1.1.5 lib/instagram/response.rb
instagram-1.1.4 lib/instagram/response.rb