Class: Isomorfeus::Transport::ResponseAgent
- Inherits:
-
Object
- Object
- Isomorfeus::Transport::ResponseAgent
- Defined in:
- lib/isomorfeus/transport/response_agent.rb
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
readonly
Returns the value of attribute agent_id.
-
#agent_result ⇒ Object
Returns the value of attribute agent_result.
-
#error ⇒ Object
Returns the value of attribute error.
-
#outer_result ⇒ Object
Returns the value of attribute outer_result.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(agent_id, request) ⇒ ResponseAgent
constructor
A new instance of ResponseAgent.
- #result ⇒ Object
Constructor Details
#initialize(agent_id, request) ⇒ ResponseAgent
Returns a new instance of ResponseAgent.
10 11 12 13 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 10 def initialize(agent_id, request) @agent_id = agent_id @request = request end |
Instance Attribute Details
#agent_id ⇒ Object (readonly)
Returns the value of attribute agent_id.
4 5 6 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 4 def agent_id @agent_id end |
#agent_result ⇒ Object
Returns the value of attribute agent_result.
6 7 8 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 6 def agent_result @agent_result end |
#error ⇒ Object
Returns the value of attribute error.
8 9 10 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 8 def error @error end |
#outer_result ⇒ Object
Returns the value of attribute outer_result.
7 8 9 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 7 def outer_result @outer_result end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 5 def request @request end |
Instance Method Details
#result ⇒ Object
15 16 17 18 19 20 |
# File 'lib/isomorfeus/transport/response_agent.rb', line 15 def result return { response: { agent_ids: { @agent_id => @error }}} if @error response = { response: { agent_ids: { @agent_id => @agent_result }}} response.deep_merge!(@outer_result) if @outer_result return response end |