Sha256: b10074dfa94dd4903bd5bdf0acbc954c3d9c430feadf632d44b9c5f5bd6266fa

Contents?: true

Size: 650 Bytes

Versions: 4

Compression:

Stored size: 650 Bytes

Contents

require 'twitter/enumerable'
require 'twitter/utils'

module Twitter
  class GeoResults
    include Twitter::Enumerable
    include Twitter::Utils
    # @return [Hash]
    attr_reader :attrs
    alias_method :to_h, :attrs
    alias_method :to_hash, :to_h
    deprecate_alias :to_hsh, :to_hash

    # 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-5.15.0 lib/twitter/geo_results.rb
twitter-5.14.0 lib/twitter/geo_results.rb
twitter-5.13.0 lib/twitter/geo_results.rb
twitter-5.12.0 lib/twitter/geo_results.rb