Sha256: e5810164cfa15f78a2fd93caf924fdbb68c817364a4571f6d6153f981caaa4ed

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 Bytes

Contents

require "twitter/enumerable"
require "twitter/utils"

module Twitter
  class GeoResults
    include Twitter::Enumerable
    include Twitter::Utils
    # @return [Hash]
    attr_reader :attrs
    alias to_h attrs
    alias to_hash to_h

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twitter-8.1.0 lib/twitter/geo_results.rb
twitter-8.0.1 lib/twitter/geo_results.rb
twitter-8.0.0 lib/twitter/geo_results.rb
twitter-8.0.0.rc.1 lib/twitter/geo_results.rb