Class: DBots::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/dbots/data.rb,
lib/dbots/lists/discordbotsgg.rb

Overview

Represents a basic service.

Direct Known Subclasses

DiscordBotsGG

Defined Under Namespace

Classes: DiscordBotsGG

Constant Summary collapse

BASE_URL =
''.freeze
AUTH_HEADER =
'Authorization'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token = nil) ⇒ Service

Returns a new instance of Service.

Parameters:

  • token (String) (defaults to: nil)

    the token/key for the service.



18
19
20
# File 'lib/dbots/data.rb', line 18

def initialize(token = nil)
  @token = token
end

Instance Attribute Details

#tokenString? Also known as: key, api_key

Returns the token that will be used for the service.

Returns:

  • (String, nil)

    the token that will be used for the service



13
14
15
# File 'lib/dbots/data.rb', line 13

def token
  @token
end

Instance Method Details

#token?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/dbots/data.rb', line 22

def token?
  @token != nil
end