Class: Useless::Doc::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/useless/doc/header.rb

Overview

Documentation for an HTTP header, belonging either to the request or the response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Header

Returns a new instance of Header.

Parameters:

  • attrs (Hash) (defaults to: {})

    corresponds to the class’s instance attributes.



18
19
20
21
# File 'lib/useless/doc/header.rb', line 18

def initialize(attrs = {})
  @key          = attrs[:key]
  @description  = attrs[:description]
end

Instance Attribute Details

#descriptionString

Returns a description of the header.

Returns:

  • (String)

    a description of the header.



13
14
15
16
17
18
19
20
21
22
# File 'lib/useless/doc/header.rb', line 13

class Header
  attr_accessor :key, :description

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @key          = attrs[:key]
    @description  = attrs[:description]
  end
end

#keyString

Returns the key of the header.

Returns:

  • (String)

    the key of the header.



13
14
15
16
17
18
19
20
21
22
# File 'lib/useless/doc/header.rb', line 13

class Header
  attr_accessor :key, :description

  # @param [Hash] attrs corresponds to the class's instance attributes.
  #
  def initialize(attrs = {})
    @key          = attrs[:key]
    @description  = attrs[:description]
  end
end