Sha256: 66a064ebd1c5c9c10645d6b51f4784a134052e365a017704cc7dfeefbed4055c

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require 'twitter/enumerable'

module Twitter
  class GeoResults
    include Twitter::Enumerable
    attr_reader :attrs
    alias to_h attrs
    alias to_hash attrs
    alias to_hsh attrs

    # Construct a new SearchResults object from a response hash
    #
    # @param response [Hash]
    # @return [Twitter::Base]
    def self.from_response(response={})
      new(response[:body])
    end

    # Initializes a new SearchResults object
    #
    # @param attrs [Hash]
    # @return [Twitter::GeoResults]
    def initialize(attrs={})
      @attrs = attrs
      @collection = Array(@attrs[:result][:places]).map do |place|
        Twitter::Place.new(place)
      end
    end

    # @return [String]
    def token
      @attrs[:token]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter-5.0.0.rc.1 lib/twitter/geo_results.rb