Class: Caldera::Events::StatsEvent
- Inherits:
-
Object
- Object
- Caldera::Events::StatsEvent
- Defined in:
- lib/caldera/events.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#cpu ⇒ Object
readonly
Returns the value of attribute cpu.
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#playing_players ⇒ Object
readonly
Returns the value of attribute playing_players.
-
#uptime ⇒ Object
readonly
Returns the value of attribute uptime.
Instance Method Summary collapse
-
#initialize(data, _node) ⇒ StatsEvent
constructor
A new instance of StatsEvent.
Constructor Details
#initialize(data, _node) ⇒ StatsEvent
Returns a new instance of StatsEvent.
75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/caldera/events.rb', line 75 def initialize(data, _node) @playing_players = data['playingPlayers'] @memory = Memory.new(**data['memory']) cpu_data = data['cpu'] snake_case_data = { cores: cpu_data['cores'], system_load: cpu_data['systemLoad'], lavalink_load: cpu_data['lavalinkLoad'] } @cpu = Cpu.new(**snake_case_data) @uptime = data['uptime'] end |
Instance Attribute Details
#cpu ⇒ Object (readonly)
Returns the value of attribute cpu.
73 74 75 |
# File 'lib/caldera/events.rb', line 73 def cpu @cpu end |
#memory ⇒ Object (readonly)
Returns the value of attribute memory.
73 74 75 |
# File 'lib/caldera/events.rb', line 73 def memory @memory end |
#playing_players ⇒ Object (readonly)
Returns the value of attribute playing_players.
73 74 75 |
# File 'lib/caldera/events.rb', line 73 def @playing_players end |
#uptime ⇒ Object (readonly)
Returns the value of attribute uptime.
73 74 75 |
# File 'lib/caldera/events.rb', line 73 def uptime @uptime end |