Class: Stattleship::LineUps

Inherits:
Endpoint
  • Object
show all
Defined in:
lib/stattleship/line_ups.rb

Constant Summary collapse

LINE_UPS =
'baseball/mlb/lineups'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Endpoint

#data

Class Method Details

.fetch(params:) ⇒ Object


5
6
7
8
# File 'lib/stattleship/line_ups.rb', line 5

def self.fetch(params:)
  super(path: LINE_UPS,
        params: params)
end

Instance Method Details

#populateObject


10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/stattleship/line_ups.rb', line 10

def populate
  lineups.each do |model|
    populate_games(model)

    games.each do |game|
      populate_game(game)
    end

    populate_players(model)
    populate_teams(model)
  end
end