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-0.21.0 lib/httpx/pmatch_extensions.rb
httpx-0.20.5 lib/httpx/pmatch_extensions.rb
httpx-0.20.4 lib/httpx/pmatch_extensions.rb
httpx-0.20.3 lib/httpx/pmatch_extensions.rb
httpx-0.20.2 lib/httpx/pmatch_extensions.rb
httpx-0.20.1 lib/httpx/pmatch_extensions.rb
httpx-0.20.0 lib/httpx/pmatch_extensions.rb
httpx-0.19.8 lib/httpx/pmatch_extensions.rb
httpx-0.19.7 lib/httpx/pmatch_extensions.rb
httpx-0.19.6 lib/httpx/pmatch_extensions.rb
httpx-0.19.5 lib/httpx/pmatch_extensions.rb
httpx-0.19.4 lib/httpx/pmatch_extensions.rb
httpx-0.19.3 lib/httpx/pmatch_extensions.rb
httpx-0.19.2 lib/httpx/pmatch_extensions.rb
httpx-0.19.1 lib/httpx/pmatch_extensions.rb
httpx-0.19.0 lib/httpx/pmatch_extensions.rb
httpx-0.18.7 lib/httpx/pmatch_extensions.rb
httpx-0.18.6 lib/httpx/pmatch_extensions.rb
httpx-0.18.5 lib/httpx/pmatch_extensions.rb
httpx-0.18.4 lib/httpx/pmatch_extensions.rb