Class: Twitter::Trends

Inherits:
Object
  • Object
show all
Includes:
Enumerable, HTTParty
Defined in:
lib/twitter/trends.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



6
7
8
# File 'lib/twitter/trends.rb', line 6

def result
  @result
end

Instance Method Details

#eachObject



14
15
16
# File 'lib/twitter/trends.rb', line 14

def each
  fetch()['trends'].each { |r| yield r }
end

#fetchObject



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

def fetch
  response = self.class.get('http://search.twitter.com/trends.json', :format => :json)
  @fetch = Mash.new(response)
  @fetch
end