Class: Infostrada::Squad

Inherits:
BaseRequest show all
Defined in:
lib/infostrada/squad.rb

Constant Summary collapse

URL =
'/GetSquad'

Constants inherited from BaseRequest

BaseRequest::RETRIES

Class Method Summary collapse

Methods inherited from BaseRequest

get!

Class Method Details

.where(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/infostrada/squad.rb', line 7

def self.where(options = {})
  edition_id = options.delete(:edition_id)
  team_id = options.delete(:team_id)

  list = get!(URL, query: { editionid: edition_id, teamid: team_id })

  list.map do |player_hash|
    Player.new(player_hash)
  end
end