Class: Blackerz::Bots

Inherits:
Object
  • Object
show all
Defined in:
lib/blackerz/sdk.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(botID, authv1) ⇒ Bots

Returns a new instance of Bots.



20
21
22
23
# File 'lib/blackerz/sdk.rb', line 20

def initialize(botID, authv1)
  self.BotID = botID
  self.AuthV1 = authv1
end

Instance Attribute Details

#AuthV1Object

Returns the value of attribute AuthV1.



8
9
10
# File 'lib/blackerz/sdk.rb', line 8

def AuthV1
  @AuthV1
end

#BotIDObject

Returns the value of attribute BotID.



8
9
10
# File 'lib/blackerz/sdk.rb', line 8

def BotID
  @BotID
end

Class Method Details

.bot_data(bot_id: String) ⇒ Object

class static method, Bots.bot_data() -> hash



11
12
13
14
15
16
17
18
# File 'lib/blackerz/sdk.rb', line 11

def self.bot_data(bot_id: String)
  res = HTTP.get("https://blackerz.herokuapp.com/api/v1/bots/" + bot_id)
  unless res.code == 200
    nil
  end
  data = res.parse
  data
end

Instance Method Details

#dataObject



24
25
26
# File 'lib/blackerz/sdk.rb', line 24

def data()
  Bots.bot_data(self.BotID)
end