Class: Useless::Doc::Response::Status
- Inherits:
-
Object
- Object
- Useless::Doc::Response::Status
- Defined in:
- lib/useless/doc/response/status.rb
Overview
Documentation for a response status for an API action.
Instance Attribute Summary collapse
-
#code ⇒ Integer
readonly
The HTTP status code of the response.
-
#description ⇒ String
readonly
A description of the rationale for the response.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(attrs = {}) ⇒ Status
Returns a new instance of Status.
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
#code ⇒ Integer (readonly)
Returns 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 |
#description ⇒ String (readonly)
Returns 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 |