Module: Instagram::Response

Defined in:
lib/instagram/response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#metaObject (readonly)

Returns the value of attribute meta


18
19
20
# File 'lib/instagram/response.rb', line 18

def meta
  @meta
end

#paginationObject (readonly)

Returns the value of attribute pagination


17
18
19
# File 'lib/instagram/response.rb', line 17

def pagination
  @pagination
end

#ratelimitObject (readonly)

Returns the value of attribute ratelimit


19
20
21
# File 'lib/instagram/response.rb', line 19

def ratelimit
  @ratelimit
end

Class Method Details

.create(response_hash, ratelimit_hash) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/instagram/response.rb', line 3

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