Class: Xshellz::ProcessInfo
- Inherits:
-
Struct
- Object
- Struct
- Xshellz::ProcessInfo
- Defined in:
- lib/xshellz/models.rb
Overview
One process row from Sandbox#procs.
Instance Attribute Summary collapse
-
#comm ⇒ Object
Returns the value of attribute comm.
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#mem ⇒ Object
Returns the value of attribute mem.
-
#pid ⇒ Object
Returns the value of attribute pid.
Class Method Summary collapse
Instance Attribute Details
#comm ⇒ Object
Returns the value of attribute comm
101 102 103 |
# File 'lib/xshellz/models.rb', line 101 def comm @comm end |
#cpu ⇒ Object
Returns the value of attribute cpu
101 102 103 |
# File 'lib/xshellz/models.rb', line 101 def cpu @cpu end |
#mem ⇒ Object
Returns the value of attribute mem
101 102 103 |
# File 'lib/xshellz/models.rb', line 101 def mem @mem end |
#pid ⇒ Object
Returns the value of attribute pid
101 102 103 |
# File 'lib/xshellz/models.rb', line 101 def pid @pid end |
Class Method Details
.from_api(payload) ⇒ Object
102 103 104 105 106 107 108 109 110 |
# File 'lib/xshellz/models.rb', line 102 def self.from_api(payload) payload ||= {} new( pid: (payload["pid"] || 0).to_i, comm: payload["comm"].to_s, cpu: (payload["cpu"] || 0.0).to_f, mem: (payload["mem"] || 0.0).to_f ) end |