FoursquareDocument
Quick and easy foursquare venue_info cache in your mongo documents
Installation
Add this line to your application's Gemfile:
gem 'foursquare_document'
And then execute:
$ bundle
Or install it yourself as:
$ gem install foursquare_document
Usage
include FoursquareDocument in your document and assign a field to contain the foursquare_id. This will automatically embed a foursquare_cache document in your model. It is set using a after_save callback.
class Venue
include Mongoid::Document
include FoursquareDocument
foursquare_id :fs_id
end
Create an initializer to set the foursquare credentials
FoursquareDocument::Config.configure do |c|
c.client_id = <your-id>
c.client_secret = <your-secret>
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request