Method: Dnsimple::Client#execute
- Defined in:
- lib/dnsimple/client.rb
#execute(method, path, data = nil, options = {}) ⇒ HTTParty::Response
Executes a request, validates and returns the response.
163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/dnsimple/client.rb', line 163 def execute(method, path, data = nil, = {}) response = request(method, path, data, ) case response.code when 200..299 response when 401 raise AuthenticationFailed, response["message"] when 404 raise NotFoundError, response else raise RequestError, response end end |