Class: Pyk::Api
- Inherits:
-
Object
- Object
- Pyk::Api
- Defined in:
- lib/pyk/api.rb
Class Method Summary collapse
-
.basic_auth(url, user_agent, username, password) ⇒ Object
Pyk::Api.basic_auth(url, user_agent, username, password).
-
.json(nestful_response) ⇒ Object
Pyk::Api.json(nestful_response).
-
.no_auth(url, user_agent) ⇒ Object
Pyk::Api.no_auth(url, user_agent).
Class Method Details
.basic_auth(url, user_agent, username, password) ⇒ Object
Pyk::Api.basic_auth(url, user_agent, username, password)
9 10 11 |
# File 'lib/pyk/api.rb', line 9 def self.basic_auth(url, user_agent, username, password) Pyk::Api.get(url, user_agent, "basic", username, password) end |
.json(nestful_response) ⇒ Object
Pyk::Api.json(nestful_response)
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/pyk/api.rb', line 21 def self.json(nestful_response) begin if !nestful_response.blank? if !nestful_response.body.blank? return JSON.parse(nestful_response.body) end end return nil rescue return nil end end |