Sha256: fd8cb12d42fe818cc68b5a8963a15414d9c42b52a14d5cdb6e125629bfa8de4e

Contents?: true

Size: 504 Bytes

Versions: 5

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

module Capybara::Poltergeist::NetworkTraffic
  class Request
    attr_reader :response_parts, :error

    def initialize(data, response_parts = [], error = nil)
      @data           = data
      @response_parts = response_parts
      @error = error
    end

    def url
      @data['url']
    end

    def method
      @data['method']
    end

    def headers
      @data['headers']
    end

    def time
      @data['time'] && Time.parse(@data['time'])
    end
  end
end

Version data entries

5 entries across 4 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/poltergeist-1.18.1/lib/capybara/poltergeist/network_traffic/request.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/poltergeist-1.18.1/lib/capybara/poltergeist/network_traffic/request.rb
poltergeist-1.18.1 lib/capybara/poltergeist/network_traffic/request.rb
poltergeist-1.18.0 lib/capybara/poltergeist/network_traffic/request.rb
poltergeist-1.17.0 lib/capybara/poltergeist/network_traffic/request.rb