Class: Sanford::Protocol::ResponseStatus::Code
- Inherits:
-
Struct
- Object
- Struct
- Sanford::Protocol::ResponseStatus::Code
- Defined in:
- lib/sanford-protocol/response_status.rb
Defined Under Namespace
Classes: NoName
Constant Summary collapse
- NUMBERS =
{ 'ok' => 200, 'bad_request' => 400, 'not_found' => 404, 'timeout' => 408, 'error' => 500 }.freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(key) ⇒ Code
constructor
A new instance of Code.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
28 29 30 |
# File 'lib/sanford-protocol/response_status.rb', line 28 def name @name end |
#number ⇒ Object
Returns the value of attribute number
28 29 30 |
# File 'lib/sanford-protocol/response_status.rb', line 28 def number @number end |
Instance Method Details
#to_s ⇒ Object
43 |
# File 'lib/sanford-protocol/response_status.rb', line 43 def to_s; "[#{[number, name].compact.join(', ')}]"; end |