Class: Sportradar::Nfl::TeamRosters

Inherits:
TeamsRequest show all
Defined in:
lib/sportradar/nfl/team_rosters.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.fetchObject



4
5
6
# File 'lib/sportradar/nfl/team_rosters.rb', line 4

def self.fetch
  new.fetch
end

.performObject



18
19
20
# File 'lib/sportradar/nfl/team_rosters.rb', line 18

def self.perform
  new.perform
end

Instance Method Details

#fetchObject



8
9
10
11
12
13
14
15
16
# File 'lib/sportradar/nfl/team_rosters.rb', line 8

def fetch
  team_rosters = []

  team_ids.each do |team_ids|
    team_rosters << TeamRoster.new(team_abbreviation: team_ids).fetch
  end

  { 'teams' => team_rosters }
end

#performObject



22
23
24
25
26
# File 'lib/sportradar/nfl/team_rosters.rb', line 22

def perform
  team_ids.each do |team_id|
    TeamRoster.new(team_abbreviation: team_id).save
  end
end