Sha256: 686d86269f1cce37fc625c93b1c9d5cdafc7505b06c8ad12886d0b151308ded1

Contents?: true

Size: 559 Bytes

Versions: 8

Compression:

Stored size: 559 Bytes

Contents

module Twitter
  class Geo
    include HTTParty
    base_uri "api.twitter.com/#{API_VERSION}/geo"
    format :json

    def self.place(place_id, query={})
      Twitter.mash(get("/id/#{place_id}.json", :query => query))
    end

    def self.search(query={})
      mashup(get("/search.json", :query => query))
    end

    def self.reverse_geocode(query={})
      mashup(get("/reverse_geocode.json", :query => query))
    end

    private

      def self.mashup(response)
        response["result"].values.flatten.map{|t| Twitter.mash(t)}
      end
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
rorra-twitter-0.9.9 lib/twitter/geo.rb
twitter-multi-0.9.8.3 lib/twitter/geo.rb
twitter-multi-0.9.8.2 lib/twitter/geo.rb
twitter-multi-0.9.8.1 lib/twitter/geo.rb
joelind-twitter-0.10.2 lib/twitter/geo.rb
joelind-twitter-0.10.1 lib/twitter/geo.rb
joelind-twitter-0.9.9 lib/twitter/geo.rb
jlind-twitter-0.9.9 lib/twitter/geo.rb