lib/twitter/geo_results.rb in twitter-5.1.1 vs lib/twitter/geo_results.rb in twitter-5.2.0

- old
+ new

@@ -2,39 +2,36 @@ module Twitter class GeoResults include Twitter::Enumerable attr_reader :attrs - alias to_h attrs - alias to_hash attrs - alias to_hsh attrs + alias_method :to_h, :attrs + alias_method :to_hash, :attrs + alias_method :to_hsh, :attrs class << self - # Construct a new GeoResults object from a response hash # # @param response [Hash] # @return [Twitter::Base] - def from_response(response={}) + def from_response(response = {}) new(response[:body]) end - end # Initializes a new GeoResults object # # @param attrs [Hash] # @return [Twitter::GeoResults] - def initialize(attrs={}) + def initialize(attrs = {}) @attrs = attrs @collection = Array(@attrs[:result][:places]).map do |place| Place.new(place) end end # @return [String] def token @attrs[:token] end - end end