Class: Angus::Remote::RemoteResponse
- Inherits:
-
Object
- Object
- Angus::Remote::RemoteResponse
- Includes:
- Angus::Remote::Response::Hash
- Defined in:
- lib/angus/remote/remote_response.rb
Overview
A service’s response
Acts as an array to store information at HTTP level, like the status_code
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#status ⇒ Object
Returns the value of attribute status.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ RemoteResponse
constructor
A new instance of RemoteResponse.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Methods included from Angus::Remote::Response::Hash
Constructor Details
#initialize ⇒ RemoteResponse
Returns a new instance of RemoteResponse.
16 17 18 |
# File 'lib/angus/remote/remote_response.rb', line 16 def initialize @http_response_info = {} end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
14 15 16 |
# File 'lib/angus/remote/remote_response.rb', line 14 def @messages end |
#status ⇒ Object
Returns the value of attribute status.
12 13 14 |
# File 'lib/angus/remote/remote_response.rb', line 12 def status @status end |
#status_code ⇒ Object
Returns the value of attribute status_code.
13 14 15 |
# File 'lib/angus/remote/remote_response.rb', line 13 def status_code @status_code end |
Instance Method Details
#[](key) ⇒ Object
24 25 26 |
# File 'lib/angus/remote/remote_response.rb', line 24 def [](key) @http_response_info[key] end |
#[]=(key, value) ⇒ Object
20 21 22 |
# File 'lib/angus/remote/remote_response.rb', line 20 def []=(key, value) @http_response_info[key] = value end |
#to_hash ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/angus/remote/remote_response.rb', line 32 def to_hash { :http_status_code => @http_response_info[:status_code], :body => @http_response_info[:body], :service_name => @http_response_info[:service_name], :operation_name => @http_response_info[:operation_name], } end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/angus/remote/remote_response.rb', line 28 def to_s "#<#{self.class}:#{object_id}>" end |