Class: TwitterSearch::Tweets
- Inherits:
-
Object
- Object
- TwitterSearch::Tweets
- Includes:
- Enumerable
- Defined in:
- lib/tweets.rb
Constant Summary collapse
- VARS =
[:since_id, :max_id, :results_per_page, :page, :query, :next_page]
Instance Method Summary collapse
- #[](index) ⇒ Object
- #each(&block) ⇒ Object
- #get_next_page ⇒ Object
- #has_next_page? ⇒ Boolean
-
#initialize(opts) ⇒ Tweets
constructor
A new instance of Tweets.
- #size ⇒ Object
Constructor Details
Instance Method Details
#[](index) ⇒ Object
32 33 34 |
# File 'lib/tweets.rb', line 32 def [](index) @results[index] end |
#each(&block) ⇒ Object
24 25 26 |
# File 'lib/tweets.rb', line 24 def each(&block) @results.each(&block) end |
#get_next_page ⇒ Object
40 41 42 43 |
# File 'lib/tweets.rb', line 40 def get_next_page client = Client.new return client.query( CGI.parse( @next_page[1..-1] ) ) end |
#has_next_page? ⇒ Boolean
36 37 38 |
# File 'lib/tweets.rb', line 36 def has_next_page? ! @next_page.nil? end |
#size ⇒ Object
28 29 30 |
# File 'lib/tweets.rb', line 28 def size @results.size end |