Module: RemoteResource::PartyQuery
- Extended by:
- ActiveSupport::Concern
- Included in:
- Connection
- Defined in:
- lib/remote_resource/concerns/party_query.rb
Defined Under Namespace
Classes: ResponseException
Instance Method Summary collapse
Instance Method Details
#query(path, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/remote_resource/concerns/party_query.rb', line 8 def query(path, ={}) result = nil = .deep_merge(.compact) time = Benchmark.ms do response = case .delete(:http_method) when :post post(path, ) else get(path, ) end raise ResponseException.new(response.code, response) if response.code != 200 result = response.parsed_response end result ensure logger.debug "(#{time.try(:round, 1) || 'Failed'} ms) #{path} opts: #{query_options.except(:logger, :log_level, :log_format)}" if logger end |