Class: ListCordRB
- Inherits:
-
Object
- Object
- ListCordRB
- Defined in:
- lib/listcordrb.rb
Overview
All ListCordRB functionality, whether extended or just here.
Defined Under Namespace
Instance Attribute Summary collapse
-
#api ⇒ String
The api key.
-
#bot ⇒ Object
readonly
Returns the value of attribute bot.
-
#id ⇒ Integer
The ID.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
-
#getbots(query, sort = 'votes', limit = 1, page = 1) ⇒ Object
Find a bot.
-
#initialize(apikey, id) ⇒ ListCordRB
constructor
Initialize a new ListCord instance, via an api-key.
-
#loadbot(id) ⇒ Object
Load a bot.
-
#makestats ⇒ Object
Initialize Stats.
Constructor Details
#initialize(apikey, id) ⇒ ListCordRB
Initialize a new ListCord instance, via an api-key.
10 11 12 13 14 |
# File 'lib/listcordrb.rb', line 10 def initialize(apikey, id) @api = apikey @id = id makestats end |
Instance Attribute Details
#api ⇒ String
Returns the api key.
22 23 24 |
# File 'lib/listcordrb.rb', line 22 def api @api end |
#bot ⇒ Object (readonly)
Returns the value of attribute bot.
52 53 54 |
# File 'lib/listcordrb.rb', line 52 def bot @bot end |
#id ⇒ Integer
Returns the ID.
25 26 27 |
# File 'lib/listcordrb.rb', line 25 def id @id end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
51 52 53 |
# File 'lib/listcordrb.rb', line 51 def stats @stats end |
Instance Method Details
#getbots(query, sort = 'votes', limit = 1, page = 1) ⇒ Object
Find a bot. Initialize the get bots
47 48 49 |
# File 'lib/listcordrb.rb', line 47 def getbots(query, sort = 'votes', limit = 1, page = 1) GetBots.new(query, sort, limit, page) end |
#loadbot(id) ⇒ Object
Load a bot.
37 38 39 |
# File 'lib/listcordrb.rb', line 37 def loadbot(id) @bot = Bot.new(id) end |
#makestats ⇒ Object
Initialize Stats
17 18 19 |
# File 'lib/listcordrb.rb', line 17 def makestats @stats = Stats.new(@api, @id) end |