lib/bleacher_api.rb in bleacher_api-0.1.4 vs lib/bleacher_api.rb in bleacher_api-0.1.5
- old
+ new
@@ -10,12 +10,12 @@
class BleacherApi
include HTTParty
class <<self
- def call(type, path, data=nil)
- base_uri BleacherApi::Config.url
+ def call(type, path, data=nil, ssl=false)
+ base_uri BleacherApi::Config.url(nil, ssl)
data, old_data = {}, data
data[type == :get ? :query : :body] = old_data
output = send(type, "/api/#{path}.json", data)
if output.code == 200
output
@@ -38,10 +38,10 @@
def login(email, password, redirect=nil)
result = BleacherApi.call(:post, 'authenticate/login', {
'user[email]' => email,
'user[password]' => password,
'redirect' => nil
- })
+ }, true)
if result
BleacherApi::Config.token result['token']
end
result
end