Sha256: dda851df38f427a530da3273f791ac88535dee0efced0c963797650060aeffdd

Contents?: true

Size: 919 Bytes

Versions: 48

Compression:

Stored size: 919 Bytes

Contents

module Inferno
  module Entities
    # A `Header` represents an HTTP request/response header
    #
    # @!attribute id
    #   @return [String] id of the header
    # @!attribute request_id
    #   @return [String] index of the HTTP request
    # @!attribute name
    #   @return [String] header name
    # @!attribute value
    #   @return [String] header value
    # @!attribute type
    #   @return [String] request/response
    class Header < Entity
      ATTRIBUTES = [:id, :request_id, :name, :type, :value].freeze

      include Inferno::Entities::Attributes

      def initialize(params)
        super(params, ATTRIBUTES)
      end

      def request?
        type == 'request'
      end

      def response?
        type == 'response'
      end

      def to_hash
        {
          id:,
          request_id:,
          type:,
          name:,
          value:
        }.compact
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
inferno_core-0.4.29 lib/inferno/entities/header.rb
inferno_core-0.4.28 lib/inferno/entities/header.rb
inferno_core-0.4.27 lib/inferno/entities/header.rb
inferno_core-0.4.26 lib/inferno/entities/header.rb
inferno_core-0.4.25 lib/inferno/entities/header.rb
inferno_core-0.4.24 lib/inferno/entities/header.rb
inferno_core-0.4.23 lib/inferno/entities/header.rb
inferno_core-0.4.22 lib/inferno/entities/header.rb
inferno_core-0.4.21 lib/inferno/entities/header.rb
inferno_core-0.4.20 lib/inferno/entities/header.rb
inferno_core-0.4.19 lib/inferno/entities/header.rb
inferno_core-0.4.18 lib/inferno/entities/header.rb
inferno_core-0.4.17 lib/inferno/entities/header.rb
inferno_core-0.4.16 lib/inferno/entities/header.rb
inferno_core-0.4.15 lib/inferno/entities/header.rb
inferno_core-0.4.14 lib/inferno/entities/header.rb
inferno_core-0.4.13 lib/inferno/entities/header.rb
inferno_core-0.4.12 lib/inferno/entities/header.rb
inferno_core-0.4.11 lib/inferno/entities/header.rb
inferno_core-0.4.10 lib/inferno/entities/header.rb