Sha256: 78a9d654133509f7d429b56b19afe12d698e51bc8862a2fcc0a7fedb952d7415

Contents?: true

Size: 647 Bytes

Versions: 1

Compression:

Stored size: 647 Bytes

Contents

module Instagram
  module Response
    def self.create(response_hash, ratelimit_hash)
      response_hash = {} unless response_hash
      data = begin
               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 = ::Hashie::Mash.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-1.3.1 lib/instagram/response.rb