Class: Sponges::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/sponges/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#supervisorObject (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_jsonObject



10
11
12
# File 'lib/sponges/response.rb', line 10

def to_json
  as_json.to_json
end