Class: RateBeer::Beer
- Inherits:
-
Object
- Object
- RateBeer::Beer
- Defined in:
- lib/ratebeer/beer.rb
Constant Summary
Constants included from URLs
URLs::BASE_URL, URLs::SEARCH_URL
Instance Attribute Summary
Attributes included from Scraping
Class Method Summary collapse
-
.data_keys ⇒ Object
Each key represents an item of data accessible for each beer, and defines dynamically a series of methods for accessing this data.
Instance Method Summary collapse
-
#initialize(id, name: nil, **options) ⇒ Beer
constructor
Create RateBeer::Beer instance.
-
#reviews(order: :most_recent, limit: 10) ⇒ Object
Return reviews of this beer.
Methods included from URLs
#beer_url, #brewery_url, #country_url, #region_url, #review_url, #style_beers_url, #style_url
Methods included from Scraping
#==, #fix_characters, #full_details, included, #inspect, nbsp, noko_doc, #page_count, #pagination?, #post_request, #symbolize_text, #to_s, #url
Constructor Details
#initialize(id, name: nil, **options) ⇒ Beer
Create RateBeer::Beer instance.
Requires the RateBeer ID# for the beer in question.
36 37 38 |
# File 'lib/ratebeer/beer.rb', line 36 def initialize(id, name: nil, **) super end |
Class Method Details
.data_keys ⇒ Object
Each key represents an item of data accessible for each beer, and defines dynamically a series of methods for accessing this data.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ratebeer/beer.rb', line 12 def self.data_keys [:name, :brewery, :style, :glassware, :availability, :abv, :calories, :description, :retired, :rating] end |