Class: BreweryDB::Client
- Inherits:
-
Object
- Object
- BreweryDB::Client
- Defined in:
- lib/brewery_db/client.rb
Instance Method Summary collapse
- #beers ⇒ Object
- #breweries ⇒ Object
-
#brewery(id) ⇒ Resources::Breweries
Builds a new instance of the brewery resource.
- #categories ⇒ Object
- #config ⇒ Object
- #configure {|config| ... } ⇒ Object
- #fermentables ⇒ Object
- #fluid_size ⇒ Object
- #glassware ⇒ Object
- #hops ⇒ Object
-
#initialize(&block) ⇒ Client
constructor
A new instance of Client.
- #locations ⇒ Object
- #menu ⇒ Object
- #search ⇒ Object
- #styles ⇒ Object
- #yeasts ⇒ Object
Constructor Details
#initialize(&block) ⇒ Client
Returns a new instance of Client.
3 4 5 |
# File 'lib/brewery_db/client.rb', line 3 def initialize(&block) configure(&block) if block_given? end |
Instance Method Details
#beers ⇒ Object
16 17 18 |
# File 'lib/brewery_db/client.rb', line 16 def beers @beers ||= Resources::Beers.new(config) end |
#breweries ⇒ Object
28 29 30 |
# File 'lib/brewery_db/client.rb', line 28 def breweries @breweries ||= Resources::Breweries.new(config) end |
#brewery(id) ⇒ Resources::Breweries
Builds a new instance of the brewery resource.
24 25 26 |
# File 'lib/brewery_db/client.rb', line 24 def brewery(id) Resources::Brewery.new(config, id: id) end |
#categories ⇒ Object
32 33 34 |
# File 'lib/brewery_db/client.rb', line 32 def categories @categories ||= Resources::Categories.new(config) end |
#config ⇒ Object
7 8 9 |
# File 'lib/brewery_db/client.rb', line 7 def config @config ||= Config.new end |
#configure {|config| ... } ⇒ Object
11 12 13 14 |
# File 'lib/brewery_db/client.rb', line 11 def configure yield(config) self end |
#fermentables ⇒ Object
36 37 38 |
# File 'lib/brewery_db/client.rb', line 36 def fermentables @fermentables ||= Resources::Fermentables.new(config) end |
#fluid_size ⇒ Object
40 41 42 |
# File 'lib/brewery_db/client.rb', line 40 def fluid_size @fluid_size ||= Resources::FluidSize.new(config) end |
#glassware ⇒ Object
44 45 46 |
# File 'lib/brewery_db/client.rb', line 44 def glassware @glassware ||= Resources::Glassware.new(config) end |
#hops ⇒ Object
48 49 50 |
# File 'lib/brewery_db/client.rb', line 48 def hops @hops ||= Resources::Hops.new(config) end |
#locations ⇒ Object
52 53 54 |
# File 'lib/brewery_db/client.rb', line 52 def locations @locations ||= Resources::Locations.new(config) end |
#menu ⇒ Object
56 57 58 |
# File 'lib/brewery_db/client.rb', line 56 def @menu ||= Resources::Menu.new(config) end |
#search ⇒ Object
60 61 62 |
# File 'lib/brewery_db/client.rb', line 60 def search @search ||= Resources::Search.new(config) end |