Module: PUBG::Client::Player
- Included in:
- PUBG::Client
- Defined in:
- lib/pubg/client/player.rb
Overview
Methods for Player API
Instance Method Summary collapse
-
#player(player_id) ⇒ Object
Find a single player by ID.
-
#players(items) ⇒ Object
Find multiple players by name or ID.
Instance Method Details
#player(player_id) ⇒ Object
Find a single player by ID
27 28 29 30 |
# File 'lib/pubg/client/player.rb', line 27 def player(player_id) path = ['shards', @region, 'players', player_id].join('/') get(path) end |
#players(items) ⇒ Object
Find multiple players by name or ID
14 15 16 17 18 19 |
# File 'lib/pubg/client/player.rb', line 14 def players(items) filter_type = items.include?('account.') ? 'playerIds' : 'playerNames' path = ['shards', @region, 'players'].join('/') = { query: { "filter[#{filter_type}]" => items } } get(path, ) end |