Project

thirst

0.0
No commit activity in last 3 years
No release in over 3 years
Pub.find if user.in_sweden?
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

thirst

If you ever wanted to:

Pub.find

to get the nearest decent pub - then this gem is for you. Just:

gem install thirst

and integrate it in whatever application you need it in. Currently you can get all pubs with:

require 'thirst'
Pub.all

and if you want the pub closest to where your IP is thought to be you can

Pub.find

furthermore an options hash can give you the closest pub to an address of a point:

oliver = Pub.find :address => "Repslagargatan 6, Stockholm"
oliver.name.should == 'Oliver Twist'

amsterdam = Pub.find :point => [57.71, 11.98]
amsterdam.name.should == 'Het Amsterdammertje'

to get a number of pubs - add count to the options hash:

five_pubs = Pub.find :count => 5
five_pubs.size.should == 5

Each pub has a name, a latitude and a longitude. More will come later.

limitations

The gem is backed up with pubs in Sweden from the list maintained by Svenska Ölfrämjandet. This data is released under a creative commons license as detailed below. You can not use this gem commercially without a specific deal with Svenska Ölfrämjandet. If you feel you need this for your own country go ahead and contribute.

Svenska Ölfrämjandets pubdatabas (Svenska Ölfrämjandet) / CC BY-NC-SA 2.5