Class: Stattleship::Pitches

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

Constant Summary collapse

PITCHES =
'baseball/mlb/pitches'.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/pitches.rb', line 5

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

Instance Method Details

#populateObject



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

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

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

    populate_pitchers(model)
    populate_hitters(model)
    populate_teams(model)
    populate_hitter_teams(model)
  end
end