Class: WhoAPI::Request
- Inherits:
-
Object
- Object
- WhoAPI::Request
- Includes:
- Symbolize
- Defined in:
- lib/whoapi/request.rb
Constant Summary collapse
- BASE_URL =
'api.whoapi.com'
Instance Method Summary collapse
-
#initialize(type, params) ⇒ Request
constructor
A new instance of Request.
- #run ⇒ Object
Methods included from Symbolize
Constructor Details
#initialize(type, params) ⇒ Request
Returns a new instance of Request.
7 8 9 10 |
# File 'lib/whoapi/request.rb', line 7 def initialize(type, params) @type = type @params = params end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/whoapi/request.rb', line 12 def run resp = call json = JSON.parse(resp.body) check_response(resp, json) json.delete('status') symbolize_recursive(json) end |