Construct a new TrendResults object from a response hash
@param response [Hash] @return [Twitter::Base]
# File lib/twitter/trend_results.rb, line 21 def from_response(response = {}) new(response[:body].first) end
Initializes a new TrendResults object
@param attrs [Hash] @return [Twitter::TrendResults]
# File lib/twitter/trend_results.rb, line 30 def initialize(attrs = {}) @attrs = attrs @collection = Array(@attrs[:trends]).map do |trend| Trend.new(trend) end end
Time when the object was created on Twitter
@return [Time]
# File lib/twitter/trend_results.rb, line 40 def as_of Time.parse(@attrs[:as_of]) unless @attrs[:as_of].nil? end
# File lib/twitter/trend_results.rb, line 45 def as_of? !!@attrs[:as_of] end
@return [Twitter::Place, NullObject]
# File lib/twitter/trend_results.rb, line 51 def location location? ? Place.new(@attrs[:locations].first) : NullObject.new end
Generated with the Darkfish Rdoc Generator 2.