Class: Useless::Doc::Response::Status

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

Overview

Documentation for a response status for an API action.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Status

Returns a new instance of Status.

Parameters:

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

    corresponds to the class’s instance attributes.



20
21
22
23
# File 'lib/useless/doc/response/status.rb', line 20

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

Instance Attribute Details

#codeInteger (readonly)

Returns the HTTP status code of the response.

Returns:

  • (Integer)

    the HTTP status code of the response.



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

class Status

  attr_reader :code, :description

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

#descriptionString (readonly)

Returns a description of the rationale for the response.

Returns:

  • (String)

    a description of the rationale for the response.



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

class Status

  attr_reader :code, :description

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