Beer Mapping
A ruby wrapper for the beermapping.com site. So the ruby community can ejoy beer whenever, whereever.
Installation
gem install beer_mapping
Example
require 'rubygems'
require 'beer_mapping'
beer = BeerMapping::API.new("YOUR_API_KEY")
beer.find_by_location("chicago") # OR beer.find_by_name("Pub Name")
beer.locations.each do |location|
# Standard data
puts location.name # Pub name
puts location.city
puts location.state
# Geo Data
puts location.geo.lng # Geo lontitude
puts location.geo.lat # Geo Latitude
# Rating Data
puts location..service
puts location..atmosphere
puts location..selection
puts location..overall
# Related Images
location.images.each do |image|
image.url
image.thumburl
image.caption
image.height
image.width
end
end
Note on Patches/Pull Requests
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2010 Phil McClure. See LICENSE for details.