Class: TwitterSearch::Tweets

Inherits:
Array
  • Object
show all
Defined in:
lib/tweets.rb

Constant Summary collapse

VARS =
[:since_id, :max_id, :results_per_page, :page, :query, :next_page]

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Tweets

Returns a new instance of Tweets.



17
18
19
20
21
22
# File 'lib/tweets.rb', line 17

def initialize(opts)
  results = opts.delete('results') || []
  results.collect! { |each| Tweet.new(each) }
  super(results)
  VARS.each { |each| instance_variable_set "@#{each}", opts[each.to_s] }
end

Instance Method Details

#get_next_pageObject



28
29
30
31
# File 'lib/tweets.rb', line 28

def get_next_page
  client = Client.new
  return client.query( CGI.parse( @next_page[1..-1] ) )
end

#has_next_page?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/tweets.rb', line 24

def has_next_page?
  ! @next_page.nil?
end