Class: HyperionResult
- Inherits:
-
Object
- Object
- HyperionResult
- Defined in:
- lib/hyperion/types/hyperion_result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(route, status, code = nil, body = nil) ⇒ HyperionResult
constructor
A new instance of HyperionResult.
- #to_s ⇒ Object
Constructor Details
#initialize(route, status, code = nil, body = nil) ⇒ HyperionResult
Returns a new instance of HyperionResult.
11 12 13 |
# File 'lib/hyperion/types/hyperion_result.rb', line 11 def initialize(route, status, code=nil, body=nil) @route, @status, @code, @body = route, status, code, body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/hyperion/types/hyperion_result.rb', line 4 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/hyperion/types/hyperion_result.rb', line 4 def code @code end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
4 5 6 |
# File 'lib/hyperion/types/hyperion_result.rb', line 4 def route @route end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/hyperion/types/hyperion_result.rb', line 4 def status @status end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/hyperion/types/hyperion_result.rb', line 15 def to_s if status == HyperionStatus::CHECK_CODE "HTTP #{code}: #{route.to_s}" elsif status == HyperionStatus::BAD_ROUTE "#{status.value.to_s.humanize} (#{code}): #{route.to_s}" else "#{status.value.to_s.humanize}: #{route.to_s}" end end |