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.6.1 lib/inferno/entities/header.rb
inferno_core-0.6.0 lib/inferno/entities/header.rb
inferno_core-0.5.4 lib/inferno/entities/header.rb
inferno_core-0.5.3 lib/inferno/entities/header.rb
inferno_core-0.5.2 lib/inferno/entities/header.rb
inferno_core-0.5.1 lib/inferno/entities/header.rb
inferno_core-0.5.0 lib/inferno/entities/header.rb
inferno_core-0.4.44 lib/inferno/entities/header.rb
inferno_core-0.4.43 lib/inferno/entities/header.rb
inferno_core-0.4.42 lib/inferno/entities/header.rb
inferno_core-0.4.41 lib/inferno/entities/header.rb
inferno_core-0.4.40 lib/inferno/entities/header.rb
inferno_core-0.4.39 lib/inferno/entities/header.rb
inferno_core-0.4.38 lib/inferno/entities/header.rb
inferno_core-0.4.35 lib/inferno/entities/header.rb
inferno_core-0.4.34 lib/inferno/entities/header.rb
inferno_core-0.4.33 lib/inferno/entities/header.rb
inferno_core-0.4.32 lib/inferno/entities/header.rb
inferno_core-0.4.31 lib/inferno/entities/header.rb
inferno_core-0.4.30 lib/inferno/entities/header.rb