Sha256: 2110ea37bf12499e13eeb806c628902473fc1d7eeb49d11aba6f1ebff72d1c26

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

module Instagram
  module Response
    def self.create(response_hash, ratelimit_hash)
      response_hash = {} unless response_hash
      data = begin
               raise if response_hash.data.nil?
               response_hash.data.dup
             rescue
               response_hash
             end
      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 = HashieWrapper.new(ratelimit_hash)
      end
      data
    end

    attr_reader :pagination
    attr_reader :meta
    attr_reader :ratelimit
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
instagram-continued-continued-1.5.0 lib/instagram/response.rb