Class: Useless::Doc::Core::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/useless/doc/core/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.



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

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.



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

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.



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

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