Module: HTTP::Headers::Mixin

Extended by:
Forwardable
Included in:
Request, Response
Defined in:
lib/http/headers/mixin.rb

Overview

Provides shared behavior for Request and Response. Expects @headers to be an instance of HTTP::Headers.

Examples:

Usage


class MyHttpRequest
  include HTTP::Headers::Mixin

  def initialize
    @headers = HTTP::Headers.new
  end
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headersHTTP::Headers (readonly)


21
22
23
# File 'lib/http/headers/mixin.rb', line 21

def headers
  @headers
end

Instance Method Details

#[]nil, ...

Smart version of HTTP::Headers#get.


25
# File 'lib/http/headers/mixin.rb', line 25

def_delegator :headers, :[]

#[]=void

This method returns an undefined value.

Sets header.


29
# File 'lib/http/headers/mixin.rb', line 29

def_delegator :headers, :[]=