Module: Scoreoid

Defined in:
lib/scoreoid.rb,
lib/scoreoid/api.rb,
lib/scoreoid/player.rb,
lib/scoreoid/version.rb

Overview

The main Scoreoid Ruby namespace.

To get started, set your Scoreoid API key and game ID with Scoreoid.configure. Then you can use API.query_and_parse to query any Scoreoid API method. See the / Scoreoid Wiki for information on available API methods.

Defined Under Namespace

Classes: API, APIError, Player

Constant Summary collapse

VERSION =

The currently loaded Scoreoid Ruby version.

'1.1.2'

Class Method Summary collapse

Class Method Details

.configure(params) ⇒ Hash

Configure Scoreoid Ruby by setting default API request parameters. You can set any parameters here, but it is only recommended to set :api_key and :game_id as they are common to all API methods.

Examples:

Setting your API key and game ID from environment variables:

Scoreoid.configure(api_key: ENV['SCOREOID_API_KEY'], game_id: ENV['SCOREOID_GAME_ID'])

Parameters:

  • params (Hash)

    A hash of default parameters to set

Options Hash (params):

  • :api_key (String)

    Your Scoreoid API key

  • :game_id (String)

    Your Scoreoid game ID

Returns:

  • (Hash)

    The parameters you just set



25
26
27
# File 'lib/scoreoid.rb', line 25

def self.configure(params)
	Scoreoid::API.default_params = params
end