Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Season Stats Methods and Tests #1000

Open
wants to merge 70 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
849b447
Initial commit.
WagglyDessert Sep 19, 2023
7f7c73d
Modified README file.
WagglyDessert Sep 19, 2023
dc28ede
Changed README font, adjusted headers.
WagglyDessert Sep 19, 2023
bf63ef0
Update README.md
XanderHendry Sep 19, 2023
67ae154
Add stat tracker
josephlee702 Sep 19, 2023
b213fbf
Add Runner file
josephlee702 Sep 19, 2023
20409b4
Merge pull request #1 from josephlee702/feat/joseph
WagglyDessert Sep 19, 2023
5e56316
Create an instance object for teams csv file and can read columns fro…
WagglyDessert Sep 19, 2023
ac2ddba
Add StatTracker initial tests
XanderHendry Sep 20, 2023
1c79081
Add more thurough setup
XanderHendry Sep 20, 2023
836ab28
Add 'skeleton' RSpec tests for multiple methods
XanderHendry Sep 20, 2023
c784df5
Add csv test samples, edit ::from_csv and runner file
XanderHendry Sep 20, 2023
c3f284c
Change csv.read to csv.readlines
XanderHendry Sep 20, 2023
2351cdd
Merge pull request #2 from josephlee702/test/StatTracker
josephlee702 Sep 20, 2023
3734754
Refactor ::from_csv to initialize as a StatTracker
XanderHendry Sep 20, 2023
17ffa3d
Add initilize tests to team_spec
XanderHendry Sep 20, 2023
fa2b633
Created methods for highest total score and lowest total score. Updat…
WagglyDessert Sep 20, 2023
4326052
Implement Team class by passing tests
XanderHendry Sep 20, 2023
43e9318
initialized game
josephlee702 Sep 20, 2023
3446012
change some strings to integers
josephlee702 Sep 20, 2023
f24da06
write attributes for game class
josephlee702 Sep 20, 2023
580f2f1
take out records to get small sample of data
josephlee702 Sep 20, 2023
d298f7f
clear records to get small sample of data
josephlee702 Sep 20, 2023
8ca3552
disregard this commit
josephlee702 Sep 20, 2023
d889e22
change number strings to int
josephlee702 Sep 20, 2023
fa495c2
add require ./lib/game
josephlee702 Sep 20, 2023
0c0d7fd
create Team class
josephlee702 Sep 20, 2023
85c5802
add the gitignore file and ignore simplecov coverage
josephlee702 Sep 20, 2023
752b278
Add GameTeams initialize test
XanderHendry Sep 20, 2023
524f62f
Created percentage home wins method.
WagglyDessert Sep 20, 2023
ef3debe
Added percentage visitor wins method.
WagglyDessert Sep 20, 2023
0899fdc
Implement GameTeam by passing test
XanderHendry Sep 20, 2023
147c3a5
Merge pull request #3 from josephlee702/feat/Team
josephlee702 Sep 20, 2023
5161dde
Merge pull request #5 from josephlee702/feat/GameTeams
josephlee702 Sep 20, 2023
d3f4bf1
Merge branch 'main' into feat/jlee
XanderHendry Sep 20, 2023
3ae73b4
Merge pull request #4 from josephlee702/feat/jlee
XanderHendry Sep 20, 2023
a7b31f5
Made alternate method for finding percent home wins to make tie metho…
WagglyDessert Sep 20, 2023
d1665e6
Implement ::from_csv by passing tests
XanderHendry Sep 21, 2023
a4e40c2
Fixed and completed methods for game teams.
WagglyDessert Sep 21, 2023
3c826cb
Add all tests for StatTracker game statistics methods
XanderHendry Sep 21, 2023
cc5341d
Merge pull request #6 from josephlee702/feat/from_csv
josephlee702 Sep 21, 2023
bb09045
Merge pull request #7 from josephlee702/tests/StatTracker_cont
josephlee702 Sep 21, 2023
9f95d63
Added methods for game statistics that function with updated classes.
WagglyDessert Sep 21, 2023
6383dc6
Merge pull request #8 from josephlee702/feat/game-statistics-methods
XanderHendry Sep 21, 2023
0943bb3
Merge branch 'main' of github.com:josephlee702/futbol into feat/natha…
WagglyDessert Sep 21, 2023
af85627
Added average goals by season method.
WagglyDessert Sep 21, 2023
46db7b2
Made new branch to merge method to main.
WagglyDessert Sep 21, 2023
53b17c6
Merge pull request #9 from josephlee702/feat/league-statistics-methods
XanderHendry Sep 21, 2023
31fed83
Added tests for league statistics methods.
WagglyDessert Sep 21, 2023
49dbd43
Refactor game statistic methods to remove unnecessary IVars
XanderHendry Sep 21, 2023
ccf2621
Merge pull request #10 from josephlee702/test/league-statistics-methods
XanderHendry Sep 21, 2023
d2c8d5c
Implement #count_of_teams by passing test
XanderHendry Sep 21, 2023
f85ca23
Implement #count_of_teams by passing tests
XanderHendry Sep 21, 2023
0fbc5af
updated some tests after i added rows
josephlee702 Sep 21, 2023
76a123c
added more rows for season variety
josephlee702 Sep 21, 2023
229c61c
added count_of_games_by_season
josephlee702 Sep 21, 2023
9a4ad6d
wrote average_goals_per_game
josephlee702 Sep 21, 2023
ef3e802
add winningest coach method and tests
josephlee702 Sep 21, 2023
4920500
Implement #best_offense by passing test
XanderHendry Sep 21, 2023
82754fd
Add worst coach method and tests
josephlee702 Sep 21, 2023
6437666
Implement #worst_offense by passing test
XanderHendry Sep 21, 2023
06c5772
Merge pull request #11 from josephlee702/refactor/remove_ivars
josephlee702 Sep 21, 2023
e076328
Merge pull request #12 from josephlee702/feat/League_stats
josephlee702 Sep 21, 2023
2e167dd
Merge branch 'main' into feat/write_game_methods
XanderHendry Sep 21, 2023
b8fbaf4
Merge pull request #13 from josephlee702/feat/write_game_methods
XanderHendry Sep 21, 2023
87659e4
Fix all errors, details in pr
XanderHendry Sep 21, 2023
98d67c2
Merge pull request #14 from josephlee702/hotfix/stat_tracker_hotfix
josephlee702 Sep 21, 2023
5588fa7
add methods and tests for best/worst coach and tackles
josephlee702 Sep 22, 2023
fffa566
fixed some spacing and other small details
josephlee702 Sep 22, 2023
ffb7dde
Adjust min to max in worst_coach method and test
josephlee702 Sep 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore test-related files
/coverage.data
/coverage/
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Futbol

Starter repository for the [Turing School](https://turing.io/) Futbol project.

# Group Commitments and DTR
- As a group, we will check in regularly as we work on branches and move through iterations. Every merge will have a group checkin.


- We will move through the iterations and divy up assignments. Each member will create branches as they work on their assignment. We will most likely also have testing branches, in addition to the code branches. All merges will be looked at by the group and we will pr merge and update our local mains together.

- A blend of async work and driver/navigator as needed when we run into problems or come together for merges. We will also look at using Trello.

- We will try to be as DRY as possible. Refactoring is built-in to iteration 3, but we will try to maek our code as single responsible as possible as we work through.

# Include link to your initial DTR document and the date it was completed. If you do additional DTRs later in the project, you should link the revised versions here as well with the date. New versions should be listed alongside older versions. Do not delete old DTRs.
https://docs.google.com/document/d/1NUJcmA-vbEgt1MOEZ9AMtp8D0DJWoKYct48TbbfzKg4/edit

# Contributors
## Xander Hendry, Joseph Lee, Nathan Trautenberg
### LinkedIn accounts:https://www.linkedin.com/in/xander-hendry-70b804289/, https://www.linkedin.com/in/joseph-lee702/, https://www.linkedin.com/in/nathan-trautenberg-9106271a7/
### Github links: https://github.com/XanderHendry, https://github.com/josephlee702, https://github.com/WagglyDessert
101 changes: 101 additions & 0 deletions data/test_game_teams.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
game_id,team_id,HoA,result,settled_in,head_coach,goals,shots,tackles,pim,powerPlayOpportunities,powerPlayGoals,faceOffWinPercentage,giveaways,takeaways
2012030221,3,away,LOSS,OT,John Tortorella,2,8,44,8,3,0,44.8,17,7
2012030221,6,home,WIN,OT,Claude Julien,3,12,51,6,4,1,55.2,4,5
2012030222,3,away,LOSS,REG,John Tortorella,2,9,33,11,5,0,51.7,1,4
2012030222,6,home,WIN,REG,Claude Julien,3,8,36,19,1,0,48.3,16,6
2012030223,6,away,WIN,REG,Claude Julien,2,8,28,6,0,0,61.8,10,7
2012030223,3,home,LOSS,REG,John Tortorella,1,6,37,2,2,0,38.2,7,9
2012030224,6,away,WIN,OT,Claude Julien,3,10,24,8,4,2,53.7,8,6
2012030225,6,home,WIN,REG,Claude Julien,3,8,35,11,3,1,49.1,12,9
2012030311,6,away,WIN,REG,Claude Julien,3,7,19,17,4,0,66.7,1,5
2012030311,5,home,LOSS,REG,Dan Bylsma,0,7,34,28,4,0,33.3,8,9
2012030312,6,away,WIN,REG,Claude Julien,4,7,19,6,1,0,50.9,2,5
2012030312,5,home,LOSS,REG,Dan Bylsma,1,6,37,4,2,0,49.1,12,5
2012030313,5,away,LOSS,OT,Dan Bylsma,1,13,46,16,6,0,57.3,8,10
2012030313,6,home,WIN,OT,Claude Julien,2,10,34,18,5,0,42.7,10,13
2012030314,5,away,LOSS,REG,Dan Bylsma,0,6,33,8,3,0,47.5,8,1
2012030314,6,home,WIN,REG,Claude Julien,1,6,25,8,3,0,52.5,11,5
2012030231,17,away,LOSS,REG,Mike Babcock,1,5,43,10,3,0,52.5,6,4
2012030231,16,home,WIN,REG,Joel Quenneville,2,10,24,10,3,1,47.5,2,11
2012030232,17,away,WIN,REG,Mike Babcock,2,7,26,6,4,0,55.4,6,6
2012030232,16,home,LOSS,REG,Joel Quenneville,1,5,36,10,2,0,44.6,7,9
2012030233,16,away,LOSS,REG,Joel Quenneville,1,10,22,22,4,0,43.9,5,6
2012030233,17,home,WIN,REG,Mike Babcock,3,7,28,10,5,0,56.1,9,3
2012030234,16,away,LOSS,REG,Joel Quenneville,0,7,22,10,3,0,48.3,8,4
2012030234,17,home,WIN,REG,Mike Babcock,2,6,30,10,3,1,51.7,10,8
2012030235,17,away,LOSS,REG,Mike Babcock,1,6,25,10,4,0,50.8,5,3
2012030235,16,home,WIN,REG,Joel Quenneville,2,11,22,12,3,2,49.2,7,7
2012030236,16,away,LOSS,REG,Joel Quenneville,2,7,16,10,5,1,39,3,5
2012030236,17,home,WIN,REG,Mike Babcock,3,9,29,12,3,0,61,12,4
2012030237,17,away,LOSS,OT,Mike Babcock,1,6,38,10,2,0,52.5,6,6
2012030237,16,home,WIN,OT,Joel Quenneville,2,8,36,6,4,0,47.5,14,9
2012030121,9,away,TIE,REG,Paul MacLean,2,7,31,23,2,0,39.4,9,1
2012030121,8,home,TIE,REG,Michel Therrien,2,12,24,6,5,1,60.6,11,10
2012030122,9,away,LOSS,REG,Paul MacLean,1,7,26,8,4,0,42.1,4,0
2012030122,8,home,WIN,REG,Michel Therrien,3,8,37,12,2,0,57.9,7,6
2012030123,8,away,LOSS,REG,Michel Therrien,1,8,44,129,6,1,47.7,13,8
2012030123,9,home,WIN,REG,Paul MacLean,4,7,47,107,11,3,52.3,8,6
2012030124,8,away,LOSS,OT,Michel Therrien,2,7,46,6,1,0,44.3,6,3
2012030124,9,home,WIN,OT,Paul MacLean,3,8,61,2,3,0,55.7,12,5
2012030125,9,away,WIN,REG,Paul MacLean,4,7,16,22,5,3,50.7,14,3
2012030125,8,home,LOSS,REG,Michel Therrien,1,8,22,32,5,1,49.3,10,4
2012030151,30,away,LOSS,OT,Mike Yeo,1,6,36,6,4,0,50,9,10
2012030151,16,home,WIN,OT,Joel Quenneville,2,9,40,8,3,1,50,17,14
2012030152,30,away,LOSS,REG,Mike Yeo,2,7,43,10,2,0,45.6,3,4
2012030152,16,home,WIN,REG,Joel Quenneville,3,12,35,6,4,0,54.4,6,14
2012030153,16,away,LOSS,OT,Joel Quenneville,2,6,13,8,2,0,44.4,3,2
2012030153,30,home,WIN,OT,Mike Yeo,3,9,34,6,3,0,55.6,7,9
2012030154,16,away,WIN,REG,Joel Quenneville,3,6,10,12,2,0,53.7,4,5
2012030154,30,home,LOSS,REG,Mike Yeo,0,6,20,4,6,0,46.3,14,4
2012030155,30,away,LOSS,REG,Mike Yeo,1,5,32,18,2,0,52.5,6,4
2012030155,16,home,WIN,REG,Joel Quenneville,3,8,23,6,2,1,47.5,9,12
2012030181,26,away,LOSS,OT,Darryl Sutter,1,7,41,12,2,0,36.2,6,6
2012030181,19,home,WIN,OT,Ken Hitchcock,2,10,38,8,5,1,63.8,10,5
2012030182,26,away,LOSS,REG,Darryl Sutter,1,7,38,8,4,1,44.8,2,6
2012030182,19,home,WIN,REG,Ken Hitchcock,2,6,38,8,4,0,55.2,2,11
2012030183,19,away,LOSS,REG,Ken Hitchcock,0,7,39,10,4,0,50.9,13,2
2012030183,26,home,WIN,REG,Darryl Sutter,1,5,53,10,4,0,49.1,17,9
2012030184,19,away,WIN,REG,Ken Hitchcock,3,5,46,8,2,1,48.3,12,5
2012030184,26,home,LOSS,REG,Darryl Sutter,2,7,42,8,2,0,51.7,8,7
2012030185,26,away,WIN,OT,Darryl Sutter,3,6,30,2,2,1,50,2,7
2012030185,19,home,LOSS,OT,Ken Hitchcock,2,9,41,4,1,0,50,7,7
2012030186,19,away,LOSS,REG,Ken Hitchcock,1,5,36,2,1,0,47.2,7,2
2012030186,26,home,WIN,REG,Darryl Sutter,2,4,37,2,1,0,52.8,21,7
2012030161,17,away,LOSS,REG,Mike Babcock,1,5,24,8,4,1,51.8,13,3
2012030161,24,home,WIN,REG,Bruce Boudreau,3,6,35,8,4,2,48.2,8,2
2012030162,17,away,WIN,OT,Mike Babcock,3,8,22,10,6,3,61.5,5,4
2012030162,24,home,LOSS,OT,Bruce Boudreau,2,8,37,12,5,1,38.5,11,3
2012030163,24,away,WIN,REG,Bruce Boudreau,2,7,26,14,6,2,49.2,3,5
2012030163,17,home,LOSS,REG,Mike Babcock,0,5,16,25,6,0,50.8,9,5
2012030164,24,away,LOSS,OT,Bruce Boudreau,2,8,26,2,3,0,55.7,3,5
2012030164,17,home,WIN,OT,Mike Babcock,3,12,38,6,1,0,44.3,11,5
2012030165,17,away,LOSS,OT,Mike Babcock,2,7,19,8,3,1,51.5,12,6
2012030165,24,home,WIN,OT,Bruce Boudreau,3,8,32,11,3,1,48.5,15,5
2012030166,24,away,WIN,OT,Bruce Boudreau,3,9,25,6,0,0,46.9,4,2
2012030166,17,home,LOSS,OT,Mike Babcock,2,7,24,0,3,1,53.1,12,4
2012030167,17,away,WIN,REG,Mike Babcock,3,8,18,10,2,0,50.6,5,9
2012030167,24,home,LOSS,REG,Bruce Boudreau,2,8,34,6,4,1,49.4,9,4
2012030111,2,away,LOSS,REG,Jack Capuano,0,6,41,51,4,0,51.6,4,3
2012030111,5,home,WIN,REG,Dan Bylsma,3,6,36,38,4,2,48.4,2,7
2012030112,2,away,LOSS,REG,Jack Capuano,2,10,31,15,4,1,39,2,4
2012030112,5,home,WIN,REG,Dan Bylsma,3,8,28,15,4,1,61,11,4
2012030113,5,away,WIN,OT,Dan Bylsma,3,6,33,8,5,3,47.5,8,6
2012030113,2,home,LOSS,OT,Jack Capuano,2,9,35,12,3,0,52.5,14,19
2012030114,5,away,LOSS,REG,Dan Bylsma,2,7,26,15,2,0,46.3,12,10
2012030114,2,home,WIN,REG,Jack Capuano,4,6,33,11,4,1,53.7,8,13
2012030115,2,away,LOSS,REG,Jack Capuano,0,7,27,36,2,0,36.2,2,4
2012030115,5,home,WIN,REG,Dan Bylsma,2,7,33,30,5,1,63.8,8,5
2012030116,5,away,LOSS,OT,Dan Bylsma,2,5,23,6,1,0,39.7,10,6
2012030116,2,home,WIN,OT,Jack Capuano,3,9,31,2,3,0,60.3,7,15
2012030131,3,away,LOSS,REG,John Tortorella,1,9,41,12,4,0,48.4,7,9
2012030131,15,home,WIN,REG,Adam Oates,3,7,32,10,5,1,51.6,11,6
2012030132,3,away,LOSS,OT,John Tortorella,0,6,58,8,3,0,48.6,7,5
2012030132,15,home,WIN,OT,Adam Oates,1,9,50,10,2,1,51.4,8,11
2012030133,15,away,WIN,REG,Adam Oates,3,7,22,12,3,0,52.6,6,4
2012030133,3,home,LOSS,REG,John Tortorella,2,7,33,6,6,1,47.4,13,11
2012030134,15,away,WIN,REG,Adam Oates,3,7,20,8,2,0,35.8,9,2
2012030134,3,home,LOSS,REG,John Tortorella,2,8,38,4,4,1,64.2,4,8
2012030135,3,away,LOSS,OT,John Tortorella,1,6,43,4,4,0,41.7,14,9
2012030135,15,home,WIN,OT,Adam Oates,2,8,53,8,2,1,58.3,13,13
2012030136,15,away,LOSS,REG,Adam Oates,0,6,28,14,0,0,40,5,3
2012030136,3,home,WIN,REG,John Tortorella,1,7,33,4,5,0,60,7,6
74 changes: 74 additions & 0 deletions data/test_games.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
game_id,season,type,date_time,away_team_id,home_team_id,away_goals,home_goals,venue,venue_link
2012030221,20122013,Postseason,5/16/13,3,6,2,3,Toyota Stadium,/api/v1/venues/null
2012030222,20122013,Postseason,5/19/13,3,6,2,3,Toyota Stadium,/api/v1/venues/null
2012030223,20122013,Postseason,5/21/13,6,3,2,1,BBVA Stadium,/api/v1/venues/null
2012030224,20122013,Postseason,5/23/13,6,3,3,2,BBVA Stadium,/api/v1/venues/null
2012030225,20122013,Postseason,5/25/13,3,6,1,3,Toyota Stadium,/api/v1/venues/null
2012030311,20122013,Postseason,6/2/13,6,5,3,0,Children's Mercy Park,/api/v1/venues/null
2012030312,20122013,Postseason,6/4/13,6,5,4,1,Children's Mercy Park,/api/v1/venues/null
2012030313,20122013,Postseason,6/6/13,5,6,1,2,Toyota Stadium,/api/v1/venues/null
2012030314,20122013,Postseason,6/8/13,5,6,0,1,Toyota Stadium,/api/v1/venues/null
2012030231,20122013,Postseason,5/16/13,17,16,1,2,Gillette Stadium,/api/v1/venues/null
2012030232,20122013,Postseason,5/18/13,17,16,2,1,Gillette Stadium,/api/v1/venues/null
2012030233,20122013,Postseason,5/20/13,16,17,1,3,Dignity Health Sports Park,/api/v1/venues/null
2012030234,20122013,Postseason,5/24/13,16,17,0,2,Dignity Health Sports Park,/api/v1/venues/null
2012030235,20122013,Postseason,5/26/13,17,16,1,2,Gillette Stadium,/api/v1/venues/null
2012030236,20122013,Postseason,5/28/13,16,17,2,3,Dignity Health Sports Park,/api/v1/venues/null
2012030237,20122013,Postseason,5/30/13,17,16,1,2,Gillette Stadium,/api/v1/venues/null
2012030121,20122013,Postseason,5/2/13,9,8,2,2,Red Bull Arena,/api/v1/venues/null
2012030122,20122013,Postseason,5/3/13,9,8,1,3,Red Bull Arena,/api/v1/venues/null
2012030123,20122013,Postseason,5/5/13,8,9,1,4,Yankee Stadium,/api/v1/venues/null
2012030124,20122013,Postseason,5/7/13,8,9,2,3,Yankee Stadium,/api/v1/venues/null
2012030125,20122013,Postseason,5/9/13,9,8,4,1,Red Bull Arena,/api/v1/venues/null
2012030151,20122013,Postseason,5/1/13,30,16,1,2,Gillette Stadium,/api/v1/venues/null
2012030152,20122013,Postseason,5/4/13,30,16,2,3,Gillette Stadium,/api/v1/venues/null
2012030153,20122013,Postseason,5/5/13,16,30,2,3,Exploria Stadium,/api/v1/venues/null
2012030154,20122013,Postseason,5/8/13,16,30,3,0,Exploria Stadium,/api/v1/venues/null
2012030155,20122013,Postseason,5/10/13,30,16,1,3,Gillette Stadium,/api/v1/venues/null
2012030181,20122013,Postseason,5/1/13,26,19,1,2,Talen Energy Stadium,/api/v1/venues/null
2012030182,20122013,Postseason,5/3/13,26,19,1,2,Talen Energy Stadium,/api/v1/venues/null
2012030183,20122013,Postseason,5/5/13,19,26,0,1,Nippert Stadium,/api/v1/venues/null
2012030184,20122013,Postseason,5/7/13,19,26,3,2,Nippert Stadium,/api/v1/venues/null
2012030185,20122013,Postseason,5/9/13,26,19,3,2,Talen Energy Stadium,/api/v1/venues/null
2012030186,20122013,Postseason,5/11/13,19,26,1,2,Nippert Stadium,/api/v1/venues/null
2012030161,20122013,Postseason,5/1/13,17,24,1,3,Rio Tinto Stadium,/api/v1/venues/null
2012030162,20122013,Postseason,5/3/13,17,24,3,2,Rio Tinto Stadium,/api/v1/venues/null
2012030163,20122013,Postseason,5/4/13,24,17,2,0,Dignity Health Sports Park,/api/v1/venues/null
2012030164,20122013,Postseason,5/7/13,24,17,2,3,Dignity Health Sports Park,/api/v1/venues/null
2012030165,20122013,Postseason,5/9/13,17,24,2,3,Rio Tinto Stadium,/api/v1/venues/null
2012030166,20122013,Postseason,5/11/13,24,17,3,2,Dignity Health Sports Park,/api/v1/venues/null
2012030167,20122013,Postseason,5/13/13,17,24,3,2,Rio Tinto Stadium,/api/v1/venues/null
2012030111,20122013,Postseason,5/1/13,2,5,0,3,Children's Mercy Park,/api/v1/venues/null
2012030112,20122013,Postseason,5/3/13,2,5,2,3,Children's Mercy Park,/api/v1/venues/null
2012030113,20122013,Postseason,5/5/13,5,2,3,2,Centruy Link Field,/api/v1/venues/null
2012030114,20122013,Postseason,5/7/13,5,2,2,4,Centruy Link Field,/api/v1/venues/null
2012030115,20122013,Postseason,5/9/13,2,5,0,2,Children's Mercy Park,/api/v1/venues/null
2012030116,20122013,Postseason,5/11/13,5,2,2,3,Centruy Link Field,/api/v1/venues/null
2012030131,20122013,Postseason,5/2/13,3,15,1,3,Providence Park,/api/v1/venues/null
2012030132,20122013,Postseason,5/4/13,3,15,0,1,Providence Park,/api/v1/venues/null
2012030133,20122013,Postseason,5/6/13,15,3,3,2,BBVA Stadium,/api/v1/venues/null
2012030134,20122013,Postseason,5/8/13,15,3,3,2,BBVA Stadium,/api/v1/venues/null
2012030135,20122013,Postseason,5/10/13,3,15,1,2,Providence Park,/api/v1/venues/null
2012030136,20122013,Postseason,5/12/13,15,3,0,1,BBVA Stadium,/api/v1/venues/null
2012030137,20122013,Postseason,5/14/13,3,15,3,0,Providence Park,/api/v1/venues/null
2012030321,20122013,Postseason,6/1/13,26,16,1,2,Gillette Stadium,/api/v1/venues/null
2012030322,20122013,Postseason,6/3/13,26,16,2,2,Gillette Stadium,/api/v1/venues/null
2012030323,20122013,Postseason,6/5/13,16,26,1,3,Nippert Stadium,/api/v1/venues/null
2012030324,20122013,Postseason,6/7/13,16,26,3,2,Nippert Stadium,/api/v1/venues/null
2012030325,20122013,Postseason,6/9/13,26,16,3,2,Gillette Stadium,/api/v1/venues/null
2016030171,20162017,Postseason,4/14/17,20,24,2,3,Rio Tinto Stadium,/api/v1/venues/null
2016030172,20162017,Postseason,4/16/17,20,24,2,3,Rio Tinto Stadium,/api/v1/venues/null
2016030173,20162017,Postseason,4/18/17,24,20,3,2,BMO Field,/api/v1/venues/null
2016030174,20162017,Postseason,4/20/17,24,20,3,1,BMO Field,/api/v1/venues/null
2014030411,20142015,Postseason,6/4/15,16,14,2,1,Audi Field,/api/v1/venues/null
2014030412,20142015,Postseason,6/6/15,16,14,3,2,Audi Field,/api/v1/venues/null
2014030413,20142015,Postseason,6/9/15,14,16,3,2,Gillette Stadium,/api/v1/venues/null
2014030414,20142015,Postseason,6/11/15,14,16,1,2,Gillette Stadium,/api/v1/venues/null
2014030415,20142015,Postseason,6/14/15,16,14,2,1,Audi Field,/api/v1/venues/null
2014030416,20142015,Postseason,6/16/15,14,16,0,2,Gillette Stadium,/api/v1/venues/null
2015030141,20152016,Postseason,4/14/16,3,5,2,3,Children's Mercy Park,/api/v1/venues/null
2015030142,20152016,Postseason,4/16/16,3,5,2,2,Children's Mercy Park,/api/v1/venues/null
2015030143,20152016,Postseason,4/19/16,5,3,3,1,BBVA Stadium,/api/v1/venues/null
2015030144,20152016,Postseason,4/21/16,5,3,3,0,BBVA Stadium,/api/v1/venues/null
2015030145,20152016,Postseason,4/23/16,3,5,3,4,Children's Mercy Park,/api/v1/venues/null
2015030181,20152016,Postseason,4/15/16,28,26,2,3,Nippert Stadium,/api/v1/venues/null
25 changes: 25 additions & 0 deletions lib/game.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Game
attr_reader :game_id,
:season,
:type,
:date_time,
:away_team_id,
:home_team_id,
:away_goals,
:home_goals,
:venue,
:venue_link

def initialize(game_info)
@game_id = game_info[:game_id].to_i
@season = game_info[:season].to_i
@type = game_info[:type]
@date_time = game_info[:date_time]
@away_team_id = game_info[:away_team_id].to_i
@home_team_id = game_info[:home_team_id].to_i
@away_goals = game_info[:away_goals].to_i
@home_goals = game_info[:home_goals].to_i
@venue = game_info[:venue]
@venue_link = game_info[:venue_link]
end
end
34 changes: 34 additions & 0 deletions lib/game_teams.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class GameTeam
attr_reader :game_id,
:team_id,
:hoa,
:result,
:settled_in,
:head_coach,
:goals,
:shots,
:tackles,
:pim,
:power_play_opportunities,
:power_play_goals,
:faceoff_win_percentage,
:giveaways,
:takeaways
def initialize(game_team_info)
@game_id = game_team_info[:game_id].to_i
@team_id = game_team_info[:team_id].to_i
@hoa = game_team_info[:hoa]
@result = game_team_info[:result]
@settled_in = game_team_info[:settled_in]
@head_coach = game_team_info[:head_coach]
@goals = game_team_info[:goals].to_i
@shots = game_team_info[:shots].to_i
@tackles = game_team_info[:tackles].to_i
@pim = game_team_info[:pim].to_i
@power_play_opportunities = game_team_info[:powerplayopportunities].to_i
@power_play_goals = game_team_info[:powerplaygoals].to_i
@faceoff_win_percentage = game_team_info[:faceoffwinpercentage].to_f
@giveaways = game_team_info[:giveaways].to_i
@takeaways = game_team_info[:takeaways].to_i
end
end
Loading