Class: Useless::Doc::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/useless/doc/response.rb,
lib/useless/doc/response/status.rb

Overview

Documentation for an HTTP response.

Defined Under Namespace

Classes: Status

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Response

Returns a new instance of Response.

Parameters:

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

    corresponds to the class’s instance attributes.



22
23
24
25
26
# File 'lib/useless/doc/response.rb', line 22

def initialize(attrs = {})
  @statuses = attrs[:statuses]
  @headers  = attrs[:headers]
  @body     = attrs[:body]
end

Instance Attribute Details

#bodyBody

Returns documentation for the body of the response.

Returns:

  • (Body)

    documentation for the body of the response.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/useless/doc/response.rb', line 17

class Response
  attr_accessor :statuses, :headers, :body

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

#headersArray<Header>

Returns documentation for the headers of the response.

Returns:

  • (Array<Header>)

    documentation for the headers of the response.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/useless/doc/response.rb', line 17

class Response
  attr_accessor :statuses, :headers, :body

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

#statusesArray<Response::Status] documentation for the possible statuses of the response.

Returns Array<Response::Status] documentation for the possible statuses of the response.

Returns:

  • (Array<Response::Status] documentation for the possible statuses of the response.)

    Array<Response::Status] documentation for the possible statuses of the response.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/useless/doc/response.rb', line 17

class Response
  attr_accessor :statuses, :headers, :body

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