Class: Tweetkit::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tweetkit/response.rb

Defined Under Namespace

Classes: Meta, Resources, Tweet, Tweets

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
12
13
# File 'lib/tweetkit/response.rb', line 7

def initialize(response)
  @original_response = response.body
  parsed_response = JSON.parse(@original_response)
  @tweets = Tweetkit::Response::Tweets.new(parsed_response)
  @meta = Tweetkit::Response::Meta.new(@tweets.meta)
  @resources = Tweetkit::Response::Resources.new(@tweets.resources)
end

Instance Attribute Details

#metaObject

Returns the value of attribute meta.



5
6
7
# File 'lib/tweetkit/response.rb', line 5

def meta
  @meta
end

#original_responseObject

Returns the value of attribute original_response.



5
6
7
# File 'lib/tweetkit/response.rb', line 5

def original_response
  @original_response
end

#resourcesObject

Returns the value of attribute resources.



5
6
7
# File 'lib/tweetkit/response.rb', line 5

def resources
  @resources
end

#tweetsObject

Returns the value of attribute tweets.



5
6
7
# File 'lib/tweetkit/response.rb', line 5

def tweets
  @tweets
end