Sha256: bd5e4b75764b1928893bde4efe3fcde0bafbb4ff67c7fbd31fd099b058aff130

Contents?: true

Size: 738 Bytes

Versions: 5

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

module MyApiClient
  module Params
    # Description of Params
    class Request
      attr_reader :method, :pathname, :headers, :query, :body

      def initialize(method, pathname, headers, query, body)
        @method = method
        @pathname = pathname
        @headers = headers
        @query = query
        @body = body
      end

      def to_sawyer_args
        [method, pathname, body, { headers: headers, query: query }]
      end

      # Returns contents as string for to be readable for human
      #
      # @return [String] Contents as string
      def inspect
        { method: method, pathname: pathname, headers: headers, query: query, body: body }.inspect
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
my_api_client-0.1.4 lib/my_api_client/params/request.rb
my_api_client-0.1.3 lib/my_api_client/params/request.rb
my_api_client-0.1.2 lib/my_api_client/params/request.rb
my_api_client-0.1.1 lib/my_api_client/params/request.rb
my_api_client-0.1.0 lib/my_api_client/params/request.rb