class Twitter::Trendline
Represents a sorted, dated and typed list of trends.
To find out when this Trendline
was created query the
as_of
attribute. To find out what type Trendline
is use the type
attribute. You can iterator over the trends in
the Trendline
with each
or by index, whichever
you prefer.
Attributes
trends[RW]
Public Class Methods
attributes()
click to toggle source
# File lib/twitter/model.rb, line 228 def attributes; @@ATTRIBUTES; end
Public Instance Methods
<=>(other)
click to toggle source
Spaceship operator definition needed by Comparable mixin for sort, etc.
# File lib/twitter/model.rb, line 233 def <=>(other) self.type === other.type && self.as_of <=> other.as_of end
[](index)
click to toggle source
index operator definition needed to iterate over trends in the
::Twitter::Trendline
object using for or otherwise
# File lib/twitter/model.rb, line 246 def [](index) trends[index] end
each() { |t| ... }
click to toggle source
each definition needed by Enumerable mixin for first, …
# File lib/twitter/model.rb, line 238 def each trends.each do |t| yield t end end
Protected Instance Methods
init()
click to toggle source
Constructor callback
# File lib/twitter/model.rb, line 253 def init @trends = @trends.collect do |trend| ::Twitter::Trend.new(trend) if trend.is_a?(Hash) end if @trends.is_a?(Array) end