Class: GameLockerAPI
- Inherits:
-
Object
- Object
- GameLockerAPI
- Defined in:
- lib/gamelocker_api.rb,
lib/gamelocker_api/match.rb,
lib/gamelocker_api/player.rb,
lib/gamelocker_api/roster.rb,
lib/gamelocker_api/version.rb,
lib/gamelocker_api/telemetry.rb,
lib/gamelocker_api/participant.rb,
lib/gamelocker_api/abstract_parser.rb
Defined Under Namespace
Classes: AbstractParser, Match, Participant, Player, Roster, Telemetry, VirtualResponse
Constant Summary collapse
- VERSION =
"0.1.4"
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(api_key, region = "na") ⇒ GameLockerAPI
constructor
A new instance of GameLockerAPI.
- #match(match_uuid = nil) ⇒ Object
- #matches(match_params = {}) ⇒ Object
-
#player(uuid) ⇒ Object
Probably does not work.
- #players(players_list = []) ⇒ Object
- #telemetry(telemetry_url) ⇒ Object
Constructor Details
#initialize(api_key, region = "na") ⇒ GameLockerAPI
Returns a new instance of GameLockerAPI.
13 14 15 16 17 18 |
# File 'lib/gamelocker_api.rb', line 13 def initialize(api_key, region = "na") @api_key = api_key @region = region @base_url= "https://api.dc01.gamelockerapp.com/shards/" @headers = {} end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
12 13 14 |
# File 'lib/gamelocker_api.rb', line 12 def base_url @base_url end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
12 13 14 |
# File 'lib/gamelocker_api.rb', line 12 def headers @headers end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
12 13 14 |
# File 'lib/gamelocker_api.rb', line 12 def region @region end |
Instance Method Details
#match(match_uuid = nil) ⇒ Object
32 33 34 |
# File 'lib/gamelocker_api.rb', line 32 def match(match_uuid = nil) match_uuid ? request("matches/#{match_uuid}") : request("matches") end |
#matches(match_params = {}) ⇒ Object
36 37 38 |
# File 'lib/gamelocker_api.rb', line 36 def matches(match_params = {}) request("matches", match_params) end |
#player(uuid) ⇒ Object
Probably does not work
21 22 23 |
# File 'lib/gamelocker_api.rb', line 21 def player(uuid) request("players/#{uuid}", {}) end |
#players(players_list = []) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/gamelocker_api.rb', line 25 def players(players_list = []) raise "Max of only 6 players" if players_list.count > 6 string = players_list.join(", ") hash = {"filter[playerNames]": string} request("players", hash) end |