Class: Twitter::SearchResults

Inherits:
Base
  • Object
show all
Defined in:
lib/twitter/search_results.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], attr_reader, fetch, fetch_or_new, from_response, identity_map, #initialize, store, #update

Constructor Details

This class inherits a constructor from Twitter::Base

Instance Method Details

#completed_inFloat

Returns:

  • (Float)


17
18
19
# File 'lib/twitter/search_results.rb', line 17

def completed_in
  @attrs[:search_metadata][:completed_in] unless @attrs[:search_metadata].nil?
end

#max_idInteger

Returns:

  • (Integer)


22
23
24
# File 'lib/twitter/search_results.rb', line 22

def max_id
  @attrs[:search_metadata][:max_id] unless @attrs[:search_metadata].nil?
end

#pageInteger

Returns:

  • (Integer)


27
28
29
# File 'lib/twitter/search_results.rb', line 27

def page
  @attrs[:search_metadata][:page] unless @attrs[:search_metadata].nil?
end

#queryString

Returns:



32
33
34
# File 'lib/twitter/search_results.rb', line 32

def query
  @attrs[:search_metadata][:query] unless @attrs[:search_metadata].nil?
end

#results_per_pageInteger Also known as: rpp

Returns:

  • (Integer)


37
38
39
# File 'lib/twitter/search_results.rb', line 37

def results_per_page
  @attrs[:search_metadata][:results_per_page] unless @attrs[:search_metadata].nil?
end

#since_idInteger

Returns:

  • (Integer)


43
44
45
# File 'lib/twitter/search_results.rb', line 43

def since_id
  @attrs[:search_metadata][:since_id] unless @attrs[:search_metadata].nil?
end

#statusesArray<Twitter::Tweet> Also known as: collection, results

Returns:



8
9
10
11
12
# File 'lib/twitter/search_results.rb', line 8

def statuses
  @results ||= Array(@attrs[:statuses]).map do |tweet|
    Twitter::Tweet.fetch_or_new(tweet)
  end
end