Module: RateBeer::URLs
Overview
This module contains URLs or URL patterns for use throughout the Gem.
Constant Summary collapse
- BASE_URL =
"http://www.ratebeer.com"- SEARCH_URL =
"/findbeer.asp"
Instance Method Summary collapse
-
#beer_url(id) ⇒ Object
Return URL to info page for beer with id.
-
#brewery_url(id) ⇒ Object
Return URL to info page for brewery with id.
-
#country_url(id) ⇒ Object
Return URL to info page for country with id.
-
#region_url(id) ⇒ Object
Return URL to info page for region with id.
-
#review_url(beer_id, sort_suffix, page_number) ⇒ Object
Return URL to page containing reviews for a given beer.
-
#style_beers_url(id) ⇒ Object
Return URL to beers list page for style with id.
-
#style_url(id) ⇒ Object
Return URL to info page for style with id.
Instance Method Details
#beer_url(id) ⇒ Object
Return URL to info page for beer with id
11 12 13 |
# File 'lib/ratebeer/urls.rb', line 11 def beer_url(id) "/beer/a/#{id}/" end |
#brewery_url(id) ⇒ Object
Return URL to info page for brewery with id
23 24 25 |
# File 'lib/ratebeer/urls.rb', line 23 def brewery_url(id) "/brewers/a/#{id}/" end |
#country_url(id) ⇒ Object
Return URL to info page for country with id
28 29 30 |
# File 'lib/ratebeer/urls.rb', line 28 def country_url(id) "/breweries/a/0/#{id}/" end |
#region_url(id) ⇒ Object
Return URL to info page for region with id
33 34 35 |
# File 'lib/ratebeer/urls.rb', line 33 def region_url(id) "/breweries/a/#{id}/0/" end |
#review_url(beer_id, sort_suffix, page_number) ⇒ Object
Return URL to page containing reviews for a given beer
17 18 19 |
# File 'lib/ratebeer/urls.rb', line 17 def review_url(beer_id, sort_suffix, page_number) "/beer/a/#{beer_id}/#{sort_suffix}/#{page_number}/" end |
#style_beers_url(id) ⇒ Object
Return URL to beers list page for style with id
43 44 45 |
# File 'lib/ratebeer/urls.rb', line 43 def style_beers_url(id) "/ajax/top-beer-by-style.asp?style=#{id}" end |
#style_url(id) ⇒ Object
Return URL to info page for style with id
38 39 40 |
# File 'lib/ratebeer/urls.rb', line 38 def style_url(id) "/beerstyles/a/#{id}/" end |