Sha256: 6e721ce7ce271ddde5cb2a303191e8b11ffdc1a149907377b027be85e3be0c41

Contents?: true

Size: 658 Bytes

Versions: 72

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

module HTTPX
  module ResponsePatternMatchExtensions
    def deconstruct
      [@status, @headers, @body]
    end

    def deconstruct_keys(_keys)
      { status: @status, headers: @headers, body: @body }
    end
  end

  module ErrorResponsePatternMatchExtensions
    def deconstruct
      [@error]
    end

    def deconstruct_keys(_keys)
      { error: @error }
    end
  end

  module HeadersPatternMatchExtensions
    def deconstruct
      to_a
    end
  end

  Headers.include HeadersPatternMatchExtensions
  Response.include ResponsePatternMatchExtensions
  ErrorResponse.include ErrorResponsePatternMatchExtensions
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
httpx-1.0.0 lib/httpx/pmatch_extensions.rb
httpx-0.24.6 lib/httpx/pmatch_extensions.rb
httpx-0.24.5 lib/httpx/pmatch_extensions.rb
httpx-0.24.4 lib/httpx/pmatch_extensions.rb
httpx-0.24.3 lib/httpx/pmatch_extensions.rb
httpx-0.24.2 lib/httpx/pmatch_extensions.rb
httpx-0.24.1 lib/httpx/pmatch_extensions.rb
httpx-0.24.0 lib/httpx/pmatch_extensions.rb
httpx-0.23.4 lib/httpx/pmatch_extensions.rb
httpx-0.23.3 lib/httpx/pmatch_extensions.rb
httpx-0.23.2 lib/httpx/pmatch_extensions.rb
httpx-0.23.1 lib/httpx/pmatch_extensions.rb
httpx-0.23.0 lib/httpx/pmatch_extensions.rb
httpx-0.22.5 lib/httpx/pmatch_extensions.rb
httpx-0.22.4 lib/httpx/pmatch_extensions.rb
httpx-0.22.3 lib/httpx/pmatch_extensions.rb
httpx-0.22.2 lib/httpx/pmatch_extensions.rb
httpx-0.22.1 lib/httpx/pmatch_extensions.rb
httpx-0.22.0 lib/httpx/pmatch_extensions.rb
httpx-0.21.1 lib/httpx/pmatch_extensions.rb