Class: DBLRuby
- Inherits:
-
Object
- Object
- DBLRuby
- Defined in:
- lib/dblruby.rb
Overview
All DBLRuby functionality, whether extended or just here.
Defined Under Namespace
Modules: Errors Classes: Bot, Search, Stats, User, Weekend, Widget
Instance Attribute Summary collapse
-
#api ⇒ Object
(also: #apikey)
Get the API Key from instantiation.
-
#id ⇒ Object
Get the ID from instantiation.
Instance Method Summary collapse
-
#bot(id) ⇒ Object
(also: #loadbot)
Load a bot.
-
#initialize(apikey, id) ⇒ DBLRuby
constructor
Initialize a new DBL API, via a key.
- #search(search: nil, limit: 50, offset: 0, sort: nil, fields: nil) ⇒ Object
-
#self ⇒ Bot
Get all of the bot’s stats as if you just called DBL.bot(id).
-
#stats ⇒ Object
Initialize stats.
-
#user(id) ⇒ Object
(also: #loaduser)
Load a user.
-
#weekend ⇒ Object
Define weekend.
-
#weekend? ⇒ Boolean
Skip the middleman, let’s just see if it’s the weekend!.
- #widget(size: 'large', file_type: 'png', small_type: nil, topcolor: nil, middlecolor: nil, usernamecolor: nil, certifiedcolor: nil, datacolor: nil, labelcolor: nil, highlightcolor: nil, avatarbg: nil, leftcolor: nil, rightcolor: nil, lefttextcolor: nil, righttextcolor: nil, id: @id) ⇒ Object
Constructor Details
#initialize(apikey, id) ⇒ DBLRuby
Initialize a new DBL API, via a key.
10 11 12 13 |
# File 'lib/dblruby.rb', line 10 def initialize(apikey, id) @api = apikey @id = id end |
Instance Attribute Details
#api ⇒ Object Also known as: apikey
Get the API Key from instantiation
80 81 82 |
# File 'lib/dblruby.rb', line 80 def api @api end |
#id ⇒ Object
Get the ID from instantiation
77 78 79 |
# File 'lib/dblruby.rb', line 77 def id @id end |
Instance Method Details
#bot(id) ⇒ Object Also known as: loadbot
Load a bot.
22 23 24 |
# File 'lib/dblruby.rb', line 22 def bot(id) Bot.new(id: id) end |
#search(search: nil, limit: 50, offset: 0, sort: nil, fields: nil) ⇒ Object
67 68 69 |
# File 'lib/dblruby.rb', line 67 def search(search: nil, limit: 50, offset: 0, sort: nil, fields: nil) Search.new(search: search, limit: limit, offset: offset, sort: sort, fields: fields) end |
#self ⇒ Bot
Get all of the bot’s stats as if you just called DBL.bot(id)
30 31 32 |
# File 'lib/dblruby.rb', line 30 def self bot(@id) end |
#stats ⇒ Object
Initialize stats
16 17 18 |
# File 'lib/dblruby.rb', line 16 def stats Stats.new(@api, @id) end |
#user(id) ⇒ Object Also known as: loaduser
Load a user
36 37 38 |
# File 'lib/dblruby.rb', line 36 def user(id) User.new(id) end |
#weekend ⇒ Object
Define weekend
57 58 59 |
# File 'lib/dblruby.rb', line 57 def weekend Weekend.new end |
#weekend? ⇒ Boolean
Skip the middleman, let’s just see if it’s the weekend!
62 63 64 |
# File 'lib/dblruby.rb', line 62 def weekend? weekend.weekend? end |
#widget(size: 'large', file_type: 'png', small_type: nil, topcolor: nil, middlecolor: nil, usernamecolor: nil, certifiedcolor: nil, datacolor: nil, labelcolor: nil, highlightcolor: nil, avatarbg: nil, leftcolor: nil, rightcolor: nil, lefttextcolor: nil, righttextcolor: nil, id: @id) ⇒ Object
72 73 74 |
# File 'lib/dblruby.rb', line 72 def (size: 'large', file_type: 'png', small_type: nil, topcolor: nil, middlecolor: nil, usernamecolor: nil, certifiedcolor: nil, datacolor: nil, labelcolor: nil, highlightcolor: nil, avatarbg: nil, leftcolor: nil, rightcolor: nil, lefttextcolor: nil, righttextcolor: nil, id: @id) Widget.new(size: size, file_type: file_type, small_type: small_type, topcolor: topcolor, middlecolor: middlecolor, usernamecolor: usernamecolor, certifiedcolor: certifiedcolor, datacolor: datacolor, labelcolor: labelcolor, highlightcolor: highlightcolor, avatarbg: avatarbg, leftcolor: leftcolor, rightcolor: rightcolor, lefttextcolor: lefttextcolor, righttextcolor: righttextcolor, id: id) end |