7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/contactology/api.rb', line 7
def query(method, attributes = {})
configuration = (attributes)
handlers = extract_handlers!(attributes)
remove_empty_values!(attributes)
response = HTTParty.get(configuration.endpoint, {
:query => {:key => configuration.key, :method => method}.merge(attributes),
:headers => ,
:parser => request_parser
})
handle_query_response(response, handlers)
rescue Timeout::Error
call_response_handler(handlers[:on_timeout], nil)
end
|