Class: DBots::Poster

Inherits:
Object
  • Object
show all
Defined in:
lib/dbots/poster.rb

Overview

A class that posts server count to listing site(s).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id, api_keys: {}) ⇒ Poster

Returns a new instance of Poster.

Parameters:

  • the (String, Integer, #resolve_id)

    client ID used for posting to a service



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

def initialize(client_id, api_keys: {})
  @client_id = client_id.respond_to?(:resolve_id) ? client_id.resolve_id.to_s : client_id.to_s
  @api_keys = api_keys
end

Instance Attribute Details

#api_keysHash Also known as: tokens, keys

Returns the API keys that the poster is using.

Returns:

  • (Hash)

    the API keys that the poster is using



5
6
7
# File 'lib/dbots/poster.rb', line 5

def api_keys
  @api_keys
end

#client_idString

Returns the client ID used for posting to a service.

Returns:

  • (String)

    the client ID used for posting to a service



10
11
12
# File 'lib/dbots/poster.rb', line 10

def client_id
  @client_id
end