Sha256: 0c7970a1cba6f01a8d081a63803b78cb4845e35f55a5d559798b75353525c8e5

Contents?: true

Size: 663 Bytes

Versions: 11

Compression:

Stored size: 663 Bytes

Contents

module VCR
  class Request < Struct.new(:method, :uri, :body, :headers)
    include Normalizers::Header
    include Normalizers::URI
    include Normalizers::Body

    def self.from_net_http_request(net_http, request)
      new(
        request.method.downcase.to_sym,
        VCR.http_stubbing_adapter.request_uri(net_http, request),
        request.body,
        request.to_hash
      )
    end

    @@object_method = Object.instance_method(:method)
    def method(*args)
      return super if args.empty?
      @@object_method.bind(self).call(*args)
    end

    def matcher(match_attributes)
      RequestMatcher.new(self, match_attributes)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vcr-1.11.3 lib/vcr/structs/request.rb
vcr-1.11.2 lib/vcr/structs/request.rb
vcr-1.11.1 lib/vcr/structs/request.rb
vcr-1.10.3 lib/vcr/structs/request.rb
vcr-1.10.2 lib/vcr/structs/request.rb
vcr-1.10.0 lib/vcr/structs/request.rb
vcr-1.9.0 lib/vcr/structs/request.rb
vcr-1.8.0 lib/vcr/structs/request.rb
vcr-1.7.2 lib/vcr/structs/request.rb
vcr-1.7.1 lib/vcr/structs/request.rb
vcr-1.7.0 lib/vcr/structs/request.rb