Module: RateBeer::URLs

Included in:
Beer::Alias, Beer::Beer, Brewery::BeerList, Brewery::Brewery, Location, Review, Search, Style, Style
Defined in:
lib/ratebeer/urls.rb

Overview

This module contains URLs or URL patterns for use throughout the Gem.

Constant Summary collapse

BASE_URL =
'https://www.ratebeer.com'
SEARCH_URL =
'/search'

Instance Method Summary collapse

Instance Method Details

#beer_url(id) ⇒ Object

Return URL to info page for beer with id



12
13
14
# File 'lib/ratebeer/urls.rb', line 12

def beer_url(id)
  "/beer/a/#{id}/"
end

#brewery_beers_url(id) ⇒ Object

Return URL to beer listing page for brewery with id.



28
29
30
# File 'lib/ratebeer/urls.rb', line 28

def brewery_beers_url(id)
  "/Ratings/Beer/ShowBrewerBeers.asp?BrewerID=#{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



33
34
35
# File 'lib/ratebeer/urls.rb', line 33

def country_url(id)
  "/breweries/a/0/#{id}/"
end

#region_url(id) ⇒ Object

Return URL to info page for region with id



38
39
40
# File 'lib/ratebeer/urls.rb', line 38

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



18
19
20
# File 'lib/ratebeer/urls.rb', line 18

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



48
49
50
# File 'lib/ratebeer/urls.rb', line 48

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



43
44
45
# File 'lib/ratebeer/urls.rb', line 43

def style_url(id)
  "/beerstyles/a/#{id}/"
end