Class: Dbl::Stats
- Inherits:
-
Object
- Object
- Dbl::Stats
- Defined in:
- lib/topgg/stats.rb
Overview
The Stats class spreads the json response into different methods
Instance Attribute Summary collapse
-
#obj ⇒ Object
(also: #raw, #data)
readonly
Returns raw Hash of the response.
Instance Method Summary collapse
-
#initialize(obj) ⇒ Stats
constructor
Initializes the Stats class.
-
#server_count ⇒ Integer
Returns the server Count of the bot.
-
#shard_count ⇒ Integer
Returns the total number of shards.
-
#shards ⇒ Integer
The amount of servers per shard.
Constructor Details
#initialize(obj) ⇒ Stats
Initializes the Stats class
6 7 8 |
# File 'lib/topgg/stats.rb', line 6 def initialize(obj) @obj = obj end |
Instance Attribute Details
#obj ⇒ Object (readonly) Also known as: raw, data
Returns raw Hash of the response
11 12 13 |
# File 'lib/topgg/stats.rb', line 11 def obj @obj end |
Instance Method Details
#server_count ⇒ Integer
Returns the server Count of the bot
18 19 20 |
# File 'lib/topgg/stats.rb', line 18 def server_count @obj['server_count'] end |
#shard_count ⇒ Integer
Returns the total number of shards
30 31 32 |
# File 'lib/topgg/stats.rb', line 30 def shard_count @obj['shard_count'] end |
#shards ⇒ Integer
The amount of servers per shard
24 25 26 |
# File 'lib/topgg/stats.rb', line 24 def shards @obj['shards'] end |