Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Whitespace clean up

  • Loading branch information...
commit 1c2e7ae848630c82d36ad7d0f2d58eca3217bab0 1 parent 74fa3b5
@sideshowbandana authored
Showing with 23 additions and 23 deletions.
  1. +23 −23 lib/brewerydb.rb
View
46 lib/brewerydb.rb
@@ -13,75 +13,75 @@ class BreweryDb
format :json
default_params :format => 'JSON'
@@apikey = nil
-
+
def self.search(options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/search", :query => options)
Hashie::Mash.new(response['results']) if response.code == 200
end
-
+
def self.breweries(options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/breweries", :query => options)
Hashie::Mash.new(response['breweries']) if response.code == 200
end
-
+
def self.brewery(id, options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/breweries/#{id}", :query => options)
Hashie::Mash.new(response['breweries']['brewery']) if response.code == 200
end
-
+
def self.beers(options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/beers", :query => options)
Hashie::Mash.new(response['beers']) if response.code == 200
end
-
+
def self.beer(id, options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/beers/#{id}", :query => options)
Hashie::Mash.new(response['beers']['beer']) if response.code == 200
end
-
+
def self.styles(options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/styles", :query => options)
Hashie::Mash.new(response['styles']) if response.code == 200
end
-
+
def self.style(id, options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/styles/#{id}", :query => options)
Hashie::Mash.new(response['styles']['style']) if response.code == 200
end
-
+
def self.categories(options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/categories", :query => options)
Hashie::Mash.new(response['categories']) if response.code == 200
end
@@ -90,16 +90,16 @@ def self.category(id, options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/categories/#{id}", :query => options)
Hashie::Mash.new(response['categories']['category']) if response.code == 200
end
-
+
def self.glassware(options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/glassware", :query => options)
Hashie::Mash.new(response['glassware']) if response.code == 200
end
@@ -108,11 +108,11 @@ def self.glass(id, options={})
options.merge!({
:apikey => apikey
})
-
+
response = get("/glassware/#{id}", :query => options)
Hashie::Mash.new(response['glassware']['glass']) if response.code == 200
end
-
+
def self.apikey
@@apikey
end
@@ -120,10 +120,10 @@ def self.apikey
def self.apikey=(apikey)
@@apikey = apikey
end
-
+
def self.configure
yield self
end
-
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.