Class: BreweryDb2

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/brewerydb2.rb

Overview

BreweryDb.configure do |config|

config.apikey = ''

end

Constant Summary collapse

@@apikey =
nil

Class Method Summary collapse

Class Method Details

.apikeyObject



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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/beer/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/beers", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/breweries", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/brewery/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/categories", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/category/#{id}", :query => options)
  Hashie::Mash.new(response)['data'] if response.code == 200
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (BreweryDb2)

    the object that the method was called on



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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/event/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/events", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/feature/#{id}", :query => options)
  Hashie::Mash.new(response)['data'] if response.code == 200
end


143
144
145
146
147
148
149
150
# File 'lib/brewerydb2.rb', line 143

def self.featured(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/featured", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/features", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/fluidsize/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/fluidsizes", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/glass/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/glassware", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/guild/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/guilds", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
    })

  response = get("/heartbeat", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/ingredient/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/ingredients", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/location/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/locations", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/search", :query => options)
  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.socialsite(id, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/socialsite/#{id}", :query => options)
  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.socialsites(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/socialsites", :query => options)
  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, options={})
  options.merge!({
    :key => apikey
  })

  response = get("/style/#{id}", :query => options)
  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(options={})
  options.merge!({
    :key => apikey
  })

  response = get("/styles", :query => options)
  Hashie::Mash.new(response)['data'] if response.code == 200
end