Sha256: 58404edfe839a6fe3432cd0d3664747a568c9b4e55bdb73c8f22a426e3f83582
Contents?: true
Size: 1.29 KB
Versions: 18
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true module MyApiClient module Params # Description of Params class Request attr_reader :method, :uri, :headers, :body # Description of #initialize # # @param method [Symbol] describe_method_here # @param uri [URI] describe_uri_here # @param headers [Hash, nil] describe_headers_here # @param body [Hash, nil] describe_body_here def initialize(method, uri, headers, body) @method = method @uri = uri @headers = headers @body = body end # Description of #to_sawyer_args # # @return [Array<Object>] Arguments for Sawyer::Agent#call def to_sawyer_args [method, uri.to_s, body, { headers: headers }] end # Generate metadata for bugsnag. # Blank parameter will be omitted. # # @return [Hash] Metadata for bugsnag def metadata { line: "#{method.upcase} #{uri}", headers: headers, body: body, }.compact end alias to_bugsnag metadata # Returns contents as string for to be readable for human # # @return [String] Contents as string def inspect { method: method, uri: uri.to_s, headers: headers, body: body }.inspect end end end end
Version data entries
18 entries across 18 versions & 1 rubygems