Class: BreweryDb2
Overview
BreweryDb.configure do |config|
config.apikey = ''
end
Constant Summary collapse
- @@apikey =
nil
Class Method Summary collapse
- .apikey ⇒ Object
- .apikey=(apikey) ⇒ Object
- .beer(id, options = {}) ⇒ Object
- .beers(options = {}) ⇒ Object
- .breweries(options = {}) ⇒ Object
- .brewery(id, options = {}) ⇒ Object
- .categories(options = {}) ⇒ Object
- .category(id, options = {}) ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .event(id, options = {}) ⇒ Object
- .events(options = {}) ⇒ Object
- .feature(id, options = {}) ⇒ Object
- .featured(options = {}) ⇒ Object
- .features(options = {}) ⇒ Object
- .fluidsize(id, options = {}) ⇒ Object
- .fluidsizes(options = {}) ⇒ Object
- .glass(id, options = {}) ⇒ Object
- .glassware(options = {}) ⇒ Object
- .guild(id, options = {}) ⇒ Object
- .guilds(options = {}) ⇒ Object
- .heartbeat(options = {}) ⇒ Object
- .ingredient(id, options = {}) ⇒ Object
- .ingredients(options = {}) ⇒ Object
- .location(id, options = {}) ⇒ Object
- .locations(options = {}) ⇒ Object
- .search(options = {}) ⇒ Object
- .socialsite(id, options = {}) ⇒ Object
- .socialsites(options = {}) ⇒ Object
- .style(id, options = {}) ⇒ Object
- .styles(options = {}) ⇒ Object
Class Method Details
.apikey ⇒ Object
266 267 268 |
# File 'lib/brewerydb2.rb', line 266 def self.apikey @@apikey end |
.apikey=(apikey) ⇒ Object
270 271 272 |
# File 'lib/brewerydb2.rb', line 270 def self.apikey=(apikey) @@apikey = apikey end |
.beer(id, options = {}) ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/brewerydb2.rb', line 62 def self.beer(id, ={}) .merge!({ :key => apikey }) response = get("/beer/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.beers(options = {}) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/brewerydb2.rb', line 53 def self.beers(={}) .merge!({ :key => apikey }) response = get("/beers", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.breweries(options = {}) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/brewerydb2.rb', line 35 def self.breweries(={}) .merge!({ :key => apikey }) response = get("/breweries", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.brewery(id, options = {}) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/brewerydb2.rb', line 44 def self.brewery(id, ={}) .merge!({ :key => apikey }) response = get("/brewery/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.categories(options = {}) ⇒ Object
89 90 91 92 93 94 95 96 |
# File 'lib/brewerydb2.rb', line 89 def self.categories(={}) .merge!({ :key => apikey }) response = get("/categories", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.category(id, options = {}) ⇒ Object
98 99 100 101 102 103 104 105 |
# File 'lib/brewerydb2.rb', line 98 def self.category(id, ={}) .merge!({ :key => apikey }) response = get("/category/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.configure {|_self| ... } ⇒ Object
274 275 276 |
# File 'lib/brewerydb2.rb', line 274 def self.configure yield self end |
.event(id, options = {}) ⇒ Object
134 135 136 137 138 139 140 141 |
# File 'lib/brewerydb2.rb', line 134 def self.event(id, ={}) .merge!({ :key => apikey }) response = get("/event/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.events(options = {}) ⇒ Object
125 126 127 128 129 130 131 132 |
# File 'lib/brewerydb2.rb', line 125 def self.events(={}) .merge!({ :key => apikey }) response = get("/events", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.feature(id, options = {}) ⇒ Object
162 163 164 165 166 167 168 169 |
# File 'lib/brewerydb2.rb', line 162 def self.feature(id, ={}) .merge!({ :key => apikey }) response = get("/feature/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.featured(options = {}) ⇒ Object
143 144 145 146 147 148 149 150 |
# File 'lib/brewerydb2.rb', line 143 def self.featured(={}) .merge!({ :key => apikey }) response = get("/featured", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.features(options = {}) ⇒ Object
152 153 154 155 156 157 158 159 |
# File 'lib/brewerydb2.rb', line 152 def self.features(={}) .merge!({ :key => apikey }) response = get("/features", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.fluidsize(id, options = {}) ⇒ Object
181 182 183 184 185 186 187 188 |
# File 'lib/brewerydb2.rb', line 181 def self.fluidsize(id, ={}) .merge!({ :key => apikey }) response = get("/fluidsize/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.fluidsizes(options = {}) ⇒ Object
171 172 173 174 175 176 177 178 |
# File 'lib/brewerydb2.rb', line 171 def self.fluidsizes(={}) .merge!({ :key => apikey }) response = get("/fluidsizes", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.glass(id, options = {}) ⇒ Object
116 117 118 119 120 121 122 123 |
# File 'lib/brewerydb2.rb', line 116 def self.glass(id, ={}) .merge!({ :key => apikey }) response = get("/glass/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.glassware(options = {}) ⇒ Object
107 108 109 110 111 112 113 114 |
# File 'lib/brewerydb2.rb', line 107 def self.glassware(={}) .merge!({ :key => apikey }) response = get("/glassware", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.guild(id, options = {}) ⇒ Object
200 201 202 203 204 205 206 207 |
# File 'lib/brewerydb2.rb', line 200 def self.guild(id, ={}) .merge!({ :key => apikey }) response = get("/guild/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.guilds(options = {}) ⇒ Object
190 191 192 193 194 195 196 197 |
# File 'lib/brewerydb2.rb', line 190 def self.guilds(={}) .merge!({ :key => apikey }) response = get("/guilds", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.heartbeat(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/brewerydb2.rb', line 17 def self.heartbeat(={}) .merge!({ :key => apikey }) response = get("/heartbeat", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.ingredient(id, options = {}) ⇒ Object
219 220 221 222 223 224 225 226 |
# File 'lib/brewerydb2.rb', line 219 def self.ingredient(id, ={}) .merge!({ :key => apikey }) response = get("/ingredient/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.ingredients(options = {}) ⇒ Object
209 210 211 212 213 214 215 216 |
# File 'lib/brewerydb2.rb', line 209 def self.ingredients(={}) .merge!({ :key => apikey }) response = get("/ingredients", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.location(id, options = {}) ⇒ Object
238 239 240 241 242 243 244 245 |
# File 'lib/brewerydb2.rb', line 238 def self.location(id, ={}) .merge!({ :key => apikey }) response = get("/location/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.locations(options = {}) ⇒ Object
228 229 230 231 232 233 234 235 |
# File 'lib/brewerydb2.rb', line 228 def self.locations(={}) .merge!({ :key => apikey }) response = get("/locations", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.search(options = {}) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/brewerydb2.rb', line 26 def self.search(={}) .merge!({ :key => apikey }) response = get("/search", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.socialsite(id, options = {}) ⇒ Object
257 258 259 260 261 262 263 264 |
# File 'lib/brewerydb2.rb', line 257 def self.(id, ={}) .merge!({ :key => apikey }) response = get("/socialsite/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.socialsites(options = {}) ⇒ Object
247 248 249 250 251 252 253 254 |
# File 'lib/brewerydb2.rb', line 247 def self.(={}) .merge!({ :key => apikey }) response = get("/socialsites", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.style(id, options = {}) ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/brewerydb2.rb', line 80 def self.style(id, ={}) .merge!({ :key => apikey }) response = get("/style/#{id}", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |
.styles(options = {}) ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/brewerydb2.rb', line 71 def self.styles(={}) .merge!({ :key => apikey }) response = get("/styles", :query => ) Hashie::Mash.new(response)['data'] if response.code == 200 end |