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.3.4 lib/httpx/pmatch_extensions.rb
httpx-1.3.3 lib/httpx/pmatch_extensions.rb
httpx-1.3.2 lib/httpx/pmatch_extensions.rb
httpx-1.3.1 lib/httpx/pmatch_extensions.rb
httpx-1.3.0 lib/httpx/pmatch_extensions.rb
httpx-1.2.6 lib/httpx/pmatch_extensions.rb
httpx-1.2.4 lib/httpx/pmatch_extensions.rb
httpx-1.2.3 lib/httpx/pmatch_extensions.rb
httpx-1.2.2 lib/httpx/pmatch_extensions.rb
httpx-1.2.1 lib/httpx/pmatch_extensions.rb
httpx-1.2.0 lib/httpx/pmatch_extensions.rb
httpx-1.1.5 lib/httpx/pmatch_extensions.rb
httpx-1.1.4 lib/httpx/pmatch_extensions.rb
httpx-1.1.3 lib/httpx/pmatch_extensions.rb
httpx-1.1.2 lib/httpx/pmatch_extensions.rb
httpx-1.1.1 lib/httpx/pmatch_extensions.rb
httpx-1.1.0 lib/httpx/pmatch_extensions.rb
httpx-1.0.2 lib/httpx/pmatch_extensions.rb
httpx-0.24.7 lib/httpx/pmatch_extensions.rb
httpx-1.0.1 lib/httpx/pmatch_extensions.rb