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.



32
33
34
35
36
37
# File 'lib/tweets.rb', line 32

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



43
44
45
46
# File 'lib/tweets.rb', line 43

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

#has_next_page?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/tweets.rb', line 39

def has_next_page?
  ! @next_page.nil?
end