class Twitter::TrendResults
Attributes
attrs[R]
@return [Hash]
to_h[R]
@return [Hash]
to_hash[R]
@return [Hash]
Public Class Methods
new(attrs = {})
click to toggle source
Initializes a new TrendResults
object
@param attrs [Hash] @return [Twitter::TrendResults]
# File lib/twitter/trend_results.rb, line 22 def initialize(attrs = {}) @attrs = attrs @collection = @attrs.fetch(:trends, []).collect do |trend| Trend.new(trend) end end
Public Instance Methods
as_of()
click to toggle source
Time when the object was created on Twitter
@return [Time]
# File lib/twitter/trend_results.rb, line 32 def as_of Time.parse(@attrs[:as_of]).utc unless @attrs[:as_of].nil? end
as_of?()
click to toggle source
# File lib/twitter/trend_results.rb, line 37 def as_of? !!@attrs[:as_of] end
location()
click to toggle source
@return [Twitter::Place, NullObject]
# File lib/twitter/trend_results.rb, line 43 def location location? ? Place.new(@attrs[:locations].first) : NullObject.new end
location?()
click to toggle source
@return [Boolean]
# File lib/twitter/trend_results.rb, line 49 def location? !@attrs[:locations].nil? && !@attrs[:locations].first.nil? end