Class: Dbl::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/topgg/stats.rb

Overview

The Stats class spreads the json response into different methods

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Stats

Initializes the Stats class

Parameters:

  • obj (Object)

    Response Hash



6
7
8
# File 'lib/topgg/stats.rb', line 6

def initialize(obj)
  @obj = obj
end

Instance Attribute Details

#objObject (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_countInteger

Returns the server Count of the bot

Returns:

  • (Integer)


18
19
20
# File 'lib/topgg/stats.rb', line 18

def server_count
  @obj['server_count']
end

#shard_countInteger

Returns the total number of shards

Returns:

  • (Integer)


30
31
32
# File 'lib/topgg/stats.rb', line 30

def shard_count
  @obj['shard_count']
end

#shardsInteger

The amount of servers per shard

Returns:

  • (Integer)


24
25
26
# File 'lib/topgg/stats.rb', line 24

def shards
  @obj['shards']
end