Class: Sponges::Response
- Inherits:
-
Object
- Object
- Sponges::Response
- Defined in:
- lib/sponges/response.rb
Instance Attribute Summary collapse
-
#supervisor ⇒ Object
readonly
Returns the value of attribute supervisor.
Instance Method Summary collapse
- #as_json(opts = {}) ⇒ Object
-
#initialize(supervisor) ⇒ Response
constructor
A new instance of Response.
- #to_json ⇒ Object
Constructor Details
#initialize(supervisor) ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/sponges/response.rb', line 6 def initialize(supervisor) @supervisor = supervisor end |
Instance Attribute Details
#supervisor ⇒ Object (readonly)
Returns the value of attribute supervisor.
4 5 6 |
# File 'lib/sponges/response.rb', line 4 def supervisor @supervisor end |
Instance Method Details
#as_json(opts = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/sponges/response.rb', line 14 def as_json(opts={}) { supervisor: process_information(supervisor.pid), children: children_information } end |
#to_json ⇒ Object
10 11 12 |
# File 'lib/sponges/response.rb', line 10 def to_json as_json.to_json end |