Class: RateBeer::Brewery
- Inherits:
-
Object
- Object
- RateBeer::Brewery
- Defined in:
- lib/ratebeer/brewery.rb
Constant Summary
Constants included from URLs
URLs::BASE_URL, URLs::SEARCH_URL
Instance Attribute Summary collapse
-
#established ⇒ Object
readonly
Returns the value of attribute established.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
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) ⇒ Brewery
constructor
Create RateBeer::Brewery instance.
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) ⇒ Brewery
Create RateBeer::Brewery instance.
Requires the RateBeer ID# for the brewery in question. Optionally accepts a name parameter where the name is already known.
31 32 33 34 35 36 37 38 39 |
# File 'lib/ratebeer/brewery.rb', line 31 def initialize(id, name: nil, **) super if @established = [:established] @location = [:location] @type = [:type] @status = [:status] end end |
Instance Attribute Details
#established ⇒ Object (readonly)
Returns the value of attribute established.
20 21 22 |
# File 'lib/ratebeer/brewery.rb', line 20 def established @established end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
20 21 22 |
# File 'lib/ratebeer/brewery.rb', line 20 def location @location 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.
9 10 11 12 13 14 15 |
# File 'lib/ratebeer/brewery.rb', line 9 def self.data_keys [:name, :type, :address, :telephone, :beers] end |