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

Update/readme #1096

Open
wants to merge 146 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
7dc2792
Initial commit
jchirch Jul 30, 2024
fd61c3e
Add: gemfile
jphill19 Jul 30, 2024
eb21b4b
Add: spec_helper.rb
jphill19 Jul 30, 2024
f3db8d6
Merge pull request #10 from kylomite/gemfile
jchirch Jul 30, 2024
3687f48
Merge pull request #11 from kylomite/feat/README-firstdraft
bwillett2003 Jul 30, 2024
d7bd802
Feat: add simplecov require & .gitignore
jphill19 Jul 30, 2024
90f9923
Merge pull request #12 from kylomite/gemfile
jchirch Jul 30, 2024
4ca7fc7
feat- set up structure for StatTracker
kylomite Jul 30, 2024
0548ae2
feat- add game class
kylomite Jul 30, 2024
6bc3405
refactor- add dummy csvs
kylomite Jul 30, 2024
87e6879
feat complete game IO set up
kylomite Jul 30, 2024
e05c64f
feat: team class
jchirch Jul 30, 2024
7b05ab4
Feat: season class set up
SThompson05 Jul 30, 2024
263bcf8
Feat: added GameStatistics class
jphill19 Jul 30, 2024
fcf3b99
Merge pull request #28 from kylomite/feat/fileIO
SThompson05 Jul 31, 2024
a2c88e5
test: add init tests
jphill19 Jul 31, 2024
a3fa3e5
test: add init test for Season & Team
jphill19 Jul 31, 2024
7231222
test: add stat_tracker tests
jphill19 Jul 31, 2024
2cbc4c3
Merge pull request #34 from kylomite/refactor/fileIO_tests
jchirch Jul 31, 2024
250d1c2
feat:completed highest_total_score and helper method.
bwillett2003 Jul 31, 2024
2bfa0b2
Merge pull request #38 from kylomite/feat/#highest_total_score
kylomite Jul 31, 2024
0666d90
refactor: removed GameStatistics class, and incorporated into StatTra…
jphill19 Jul 31, 2024
818a83c
Merge pull request #39 from kylomite/refactor/stat_tracker
kylomite Jul 31, 2024
c42f197
test: percentage home wins test suite
jchirch Aug 1, 2024
c3cb8bc
feat: percentage home wins method
jchirch Aug 1, 2024
5113817
refactor: relocated methods after data readers
jchirch Aug 1, 2024
6b89feb
test: best offense test suite
jchirch Aug 1, 2024
361334e
refactor: move highest total score test
kylomite Aug 1, 2024
9b93b3d
Merge pull request #40 from kylomite/feat/#percentage_home_wins
bwillett2003 Aug 1, 2024
c0a9fd1
Merge pull request #41 from kylomite/refactor/layout
bwillett2003 Aug 1, 2024
f42eedb
update branch to align with main
kylomite Aug 1, 2024
f4ef2b8
feat: psudocoding
jchirch Aug 1, 2024
3ed9797
feat-add test for percentage_ties
kylomite Aug 1, 2024
22fb2be
feat-pass test for percentage_ties
kylomite Aug 1, 2024
ddabfce
feat- add test for average_goals_per_game
kylomite Aug 1, 2024
c03b834
feat:completed lowest_total_score method
bwillett2003 Aug 1, 2024
5abca3d
test:lowest_total_score rspec test added
bwillett2003 Aug 1, 2024
b7270dd
Merge pull request #42 from kylomite/feat/percentage_ties
SThompson05 Aug 1, 2024
3626c3f
refactor:reused helper method in lowest_total_score
bwillett2003 Aug 1, 2024
1890b52
refactor: more psudocode
jchirch Aug 1, 2024
71d7b28
refactor:updated to match main branch
bwillett2003 Aug 1, 2024
9a86425
feat:Created lowest_total_score method.
bwillett2003 Aug 1, 2024
d386c62
merge: merge current remote main into branch
jchirch Aug 1, 2024
907c71f
Merge pull request #43 from kylomite/feat/lowest_total_score
kylomite Aug 1, 2024
4b1895b
feat-pass test for average_goals_per_game
kylomite Aug 1, 2024
c6df5cc
Merge pull request #44 from kylomite/feat/average_goals_per_game
SThompson05 Aug 1, 2024
6fd337a
feat: add prelim test for highest_scoring_visitor
kylomite Aug 1, 2024
8fcb5d3
feat: pass prelim test for highest_scoring_visitor
kylomite Aug 2, 2024
73628f6
feat: complete test and imp for highest_scoring_visitor
kylomite Aug 2, 2024
70dda99
fix- fixes rounding error which occurs in full dataset
kylomite Aug 2, 2024
cd79e9a
fix: building out #best_offense
jchirch Aug 2, 2024
2b04bd3
feat: count_of_games_season
SThompson05 Aug 2, 2024
93d9807
Merge pull request #45 from kylomite/feat/highest_scoring_visitor
SThompson05 Aug 2, 2024
fbeaa3e
feat- add prelim test for least_accurate_team
kylomite Aug 2, 2024
f189534
feat: best offense and id to name methods
jchirch Aug 2, 2024
82c9399
test: id to name helper method
jchirch Aug 2, 2024
9d7f5f2
test: test suite for lowest scoring visitor
jchirch Aug 2, 2024
95cb89f
feat: lowest scoring visitor
jchirch Aug 2, 2024
fa71cbb
test: worst coach test suite, assertion line draft 1
jchirch Aug 2, 2024
22d7e6a
pass test for least_accurate_team
kylomite Aug 2, 2024
aa6a003
Merge pull request #48 from kylomite/feat/least_accurate_team
SThompson05 Aug 2, 2024
d9829d3
refactor: merged helper method into best offense test suite
jchirch Aug 2, 2024
82b4162
Merge pull request #46 from kylomite/feat/#best_offense
bwillett2003 Aug 2, 2024
eb138c6
Merge pull request #47 from kylomite/feat/#lowest_scoring_visitor
bwillett2003 Aug 2, 2024
91dbf73
Merge pull request #50 from kylomite/refactor/test/best_offense
bwillett2003 Aug 2, 2024
35f3137
feat: count_of_teams method created
bwillett2003 Aug 2, 2024
01f97a9
test:count_of_teams rspec test created
bwillett2003 Aug 2, 2024
866fd92
docs: readme includes retro meeting points
jchirch Aug 2, 2024
697c0ac
Merge pull request #51 from kylomite/update/readme
bwillett2003 Aug 2, 2024
5a3a4b0
refactor: method returns correct format for percentages
jchirch Aug 2, 2024
42337ec
Merge pull request #53 from kylomite/refactor/#percentage_homewins
bwillett2003 Aug 2, 2024
c9bfc0d
Merge branch 'main' into feat/count_of_teams
kylomite Aug 2, 2024
21ef72c
Merge pull request #52 from kylomite/feat/count_of_teams
kylomite Aug 2, 2024
5b00bdd
add prelim test for fewest_tackles
kylomite Aug 2, 2024
8f30ecb
pass test for fewest_tackles
kylomite Aug 2, 2024
0c7b443
test: updated test language
SThompson05 Aug 2, 2024
625d554
Merge pull request #54 from kylomite/feat/fewest_tackles
SThompson05 Aug 2, 2024
68f81e6
Merge branch 'main' of github.com:kylomite/futbol into feat/#count_of…
SThompson05 Aug 2, 2024
7cc6584
feat: worst coach method and id to coach helper method
jchirch Aug 3, 2024
f11ce6c
test: id to coach helper method works across csv
jchirch Aug 3, 2024
efc5584
feat: average_goals_by_season
SThompson05 Aug 3, 2024
ca02120
refactor: average_goals_by_season
SThompson05 Aug 3, 2024
6f7db2b
feat: average_goals_by_season
SThompson05 Aug 3, 2024
3929331
feat: add percentage_visitor_wins method & test
jphill19 Aug 3, 2024
2d62a2d
feat: started set up of highest_scoring_team
SThompson05 Aug 3, 2024
cf56fb3
Feat: added team_scoring_helper method
jphill19 Aug 3, 2024
2a8b653
Test: added team_seasons_goal test
jphill19 Aug 3, 2024
969e991
refactor: count_of_games_by_season to comply with spec harness
SThompson05 Aug 3, 2024
c8e42a5
Feat: added worst_offense method & test
jphill19 Aug 3, 2024
a5493cb
Refactor: added parameter to team_seasons_goals
jphill19 Aug 3, 2024
0607932
Test: added team_seasons_goals parameter tests
jphill19 Aug 3, 2024
bc7cf86
refactor: average_goals_by_season to comply with spec harness & imple…
SThompson05 Aug 3, 2024
75e26cd
Refactored lowest_scoring_vistior, worst_offense, best_offense, Add l…
jphill19 Aug 3, 2024
b4f19f7
Feat: add teams_scores_average_min_by & teams_scores_average_max_by
jphill19 Aug 3, 2024
15534cb
Test: add test for lowest_scoring_home_team, teams_scores_average_min…
jphill19 Aug 3, 2024
4448392
Merge pull request #60 from kylomite/feat/#count_of_games_by_season
jphill19 Aug 3, 2024
285c5f9
Merge branch 'main' into feat/average_goals_by_season
jphill19 Aug 3, 2024
815fdf1
Merge pull request #61 from kylomite/feat/average_goals_by_season
jphill19 Aug 3, 2024
ade92e7
Merge branch 'main' of github.com:kylomite/futbol into feat/highest_s…
SThompson05 Aug 3, 2024
27924ca
Merge pull request #58 from kylomite/feat/percentage_visitor_wins
jchirch Aug 3, 2024
145db26
Merge branch 'main' of github.com:kylomite/futbol into feat/highest_s…
SThompson05 Aug 3, 2024
c8f2bf3
Merge pull request #59 from kylomite/feat/worst_offense
jchirch Aug 3, 2024
513bf5b
Merge branch 'main' of github.com:kylomite/futbol into feat/highest_s…
SThompson05 Aug 3, 2024
0cf3cbe
Merge pull request #62 from kylomite/feat/lowest_scoring_home_team
jchirch Aug 3, 2024
4570492
refactor: worst coach
jchirch Aug 3, 2024
07761d7
feat: highest_scoring_team w/ test and mocks
SThompson05 Aug 3, 2024
c5512bd
refactor: worst coach to pass spec harness
jchirch Aug 3, 2024
1f5ad61
Merge branch 'main' of github.com:kylomite/futbol into feat/highest_s…
SThompson05 Aug 4, 2024
1a72cac
Refactor: highest_scoring_home_team and updated tests
SThompson05 Aug 4, 2024
076c9b8
Merge branch 'main' of github.com:kylomite/futbol into feat/most_tackles
SThompson05 Aug 4, 2024
c9c41b3
Merge pull request #64 from kylomite/feat/highest_scoring_home_team
jphill19 Aug 4, 2024
72b1adb
Feat: added most_accurate_team & respective helper methods
jphill19 Aug 4, 2024
1555d77
Test: added teams_shots_and_goals test
jphill19 Aug 4, 2024
60ab6f9
Test: added most_accurate_team & teams_shots_and_goals tests
jphill19 Aug 4, 2024
8f7b014
Merge pull request #65 from kylomite/feat/#most_accurate_team
jchirch Aug 4, 2024
633e470
feat: most_tackles work in progress
SThompson05 Aug 4, 2024
3949a18
refactor: worst coach helper methods
jchirch Aug 4, 2024
a18226b
test: win loss ratio test suite
jchirch Aug 4, 2024
9862baf
Refactor: Refactored fewest tackles and added helper methods
jphill19 Aug 4, 2024
700dd1b
Refacot: removed commented code
jphill19 Aug 4, 2024
7e27b0d
Test: added team_tackles_in_games test
jphill19 Aug 4, 2024
c710da3
test: id to coach test suite
jchirch Aug 4, 2024
e0de869
Merge pull request #66 from kylomite/refactor/fewest_tackles
jchirch Aug 4, 2024
0403dcd
Merge branch 'main' into feat/#worst_coach
bwillett2003 Aug 4, 2024
f1189e4
Merge pull request #67 from kylomite/feat/#worst_coach
bwillett2003 Aug 4, 2024
c2276fe
refactor: Removed commented code for rspec test that already exists.
bwillett2003 Aug 5, 2024
36b99ab
refactor: Removed more commented code for rspec that already exists.
bwillett2003 Aug 5, 2024
d2a4863
refactor: Relocated winninest_coach method to be in line with worst_c…
bwillett2003 Aug 5, 2024
175fd24
refactor: least_accurate_team to use helper methods
kylomite Aug 5, 2024
0b9be1d
feat: winningest_coach method created using worst_coach helper methods.
bwillett2003 Aug 5, 2024
bae75ef
refactor: highest_scoring_visitor to use helper methods
kylomite Aug 5, 2024
ff1ea0f
test: winningest_coach rspec test.
bwillett2003 Aug 5, 2024
fb3a4b6
refactor: corrected indentation between id_to_name and worst_offense.
bwillett2003 Aug 5, 2024
6eced62
refactor: corrected indentation worst_offense and highest_scoring_vis…
bwillett2003 Aug 5, 2024
1ed5814
corrected more indentation between methods.
bwillett2003 Aug 5, 2024
02d05dd
Merge pull request #70 from kylomite/feat/winningest_coach
kylomite Aug 5, 2024
96866c1
feat: most_tackles completed with tests
SThompson05 Aug 5, 2024
37064e0
Merge pull request #68 from kylomite/refactor/least_accurate_team
SThompson05 Aug 5, 2024
f7b010c
Merge pull request #69 from kylomite/refactor/highest_scoring_visitor
SThompson05 Aug 5, 2024
7973634
Merge pull request #71 from kylomite/feat/most_tackles
jphill19 Aug 5, 2024
5a47a45
refactor: Removed commented code.
bwillett2003 Aug 5, 2024
cdeb1be
refactor: Removed commented code and improved white space.
bwillett2003 Aug 5, 2024
b80a944
Merge pull request #72 from kylomite/refactor/stat_tracker_spec
kylomite Aug 5, 2024
ed98651
refactor: updating README.
bwillett2003 Aug 5, 2024
8fb792e
refactor: Updated LinkedIn URL
bwillett2003 Aug 5, 2024
9af995b
docs: Completed README
bwillett2003 Aug 5, 2024
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
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Ignore bundler config
/.bundle

# Ignore the SimpleCov coverage directory
/coverage

# Ignore logs and temp files
/log/*
!/log/.keep
/tmp
/pids

# Ignore Byebug command history file.
.byebug_history

# Ignore SQLite database files
*.sqlite3
*.sqlite3-journal

# Ignore Node modules (if you're using Node.js with your Ruby project)
/node_modules

# Ignore Yarn lock file (if you're using Yarn)
/yarn.lock

# Ignore the .env file containing environment variables
.env

# Ignore OSX and Linux file system files
.DS_Store
*.swp

# Ignore RSpec example metadata
.rspec_example
.rspec_status

# Ignore Ruby version management files
.ruby-version
.ruby-gemset

# Ignore coverage results from Code Climate
/.resultset.json

# Ignore coverage results from SimpleCov
/coverage/

# Ignore installed dependencies in vendor/bundle
/vendor/bundle

# Ignore the Gemfile.lock file if you're not committing it
# Gemfile.lock

# Ignore project-specific artifacts
/.idea
/.vscode
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'rspec'
gem 'simplecov'
35 changes: 35 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.5.1)
docile (1.4.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)

PLATFORMS
arm64-darwin-22
ruby

DEPENDENCIES
rspec
simplecov

BUNDLED WITH
2.5.13
95 changes: 94 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
# Futbol

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

* The StatTracker application provides detailed statistical analysis for a sports league, covering game, league, and season metrics. It includes methods to determine the highest and lowest game scores, percentages of home and visitor wins, average goals per game, and games by season. League statistics cover team performance, identifying the best and worst offenses, and the highest and lowest-scoring teams at home and away. Season-specific methods analyze coach performance, team accuracy, and tackle counts. StatTracker is a comprehensive for analyzing league performance and trends.

## Built With

* Ruby 3.2.2 & RSpec 3.13

## Deliverables

**Outline of Check-ins**

* We are planning on having a standup meeting 30 minutes before class, as well as a daily post class check in.
* We plan on a larger meeting to redefine DTR on friday(tentatively).

**Plan Organization**
* We are utilizing Github Project as our primary organization source.
* [Link to Github Project](https://github.com/users/kylomite/projects/3/views/1)
* Using Google Docs to organize more qualitative team building points.
* [Link to Google Doc](https://docs.google.com/document/d/15GMwPuLY4e56yfuwuGLphfTAbCh9uTJGeSz-cAkhpqg/edit)
* Frequent communication via Slack will be the standard.

**Project Organizer Discussion**
* When discussing the project organization tool, we considered Mirrorboard and Github Projects, but ultimately chose Github Projects due to its utility and seamless integration with our repository.
* We all agreed Github Project is most likely the industry standard and it would behoove us to familiarize ourselves with the application.

**Code Design**
* After assessing the project requirements, we decided to structure our code design around four primary classes:

* `StatTracker`: This class will encapsulate the core logic and functionality, managing most of the codebase.

* `Game`, `Team`, and `Season`: These classes will act as auxiliary components and data storage.

Additionally, we created three simplified dummy CSV files with minimal data. This approach ensures our tests execute efficiently by avoiding the overhead of processing large datasets.

To streamline our development process and prevent issues with method assignment, we established a clear code architecture from the outset.

Given our asynchronous workflow and the fact that different team members were working on various methods concurrently, we anticipated potential misalignment between our to-do list and the evolving code structure. To mitigate this risk, we preemptively defined method names in both the library (lib) and specification (spec) files, adhering to the assignment order.

* We have implemented a style guide to adhere to for consistency.
* [Link to Style Guide](https://docs.google.com/document/d/1AS3GIR84IMyoNUbN8eiSnuM3o6o9fscvlKvjhJSxokc/edit)

**DTRs**

* [First DTR 7/29/24](https://docs.google.com/document/d/1HEdpmbyhJbeJtJJ8pkOvZ5zeb07FeqkCZlBai6aSP0s/edit)

* Discussed second DTR 8/02/24

## Project Retro

**Retro**

* [Link](https://docs.google.com/document/d/1HEdpmbyhJbeJtJJ8pkOvZ5zeb07FeqkCZlBai6aSP0s/edit) to project retro.

* How to run a [retro](https://www.atlassian.com/team-playbook/plays/retrospective)

**What Went Well**

* Details in retro, but in summary:

1. Communication
1. Code Design
1. Group Dynamic

**Future Improvements**

* Details in retro, but in summary:
1. Code Spikes
1. Refactoring
1. Detail Orientation

## Contributors

* **Chirchirillo, Joe**
* [Github](https://github.com/jchirch)
* [LinkedIn](https://www.linkedin.com/in/joe-chirchirillo-a73b09318/)

* **Delaney, Kyle**
* [Github](https://github.com/kylomite)
* [LinkedIn](https://www.linkedin.com/in/kyle-delaney-115164172)

* **Hill, John**
* [Github](https://github.com/jphill19)
* [LinkedIn](https://www.linkedin.com/in/john-hill-309715245/)

* **Thompson, Shawn**
* [Github](https://github.com/SThompson05)
* [LinkedIn](https://www.linkedin.com/in/shawn-thompson-16956267/)

* **Willett, Bryan**
* [Github](https://github.com/bwillett2003)
* [LinkedIn](https://www.linkedin.com/in/bryan-willett-063060321/)


15 changes: 15 additions & 0 deletions data/game_teams_dummy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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
2012030224,3,home,LOSS,OT,John Tortorella,2,8,40,8,4,1,46.3,9,7
2012030225,3,away,LOSS,REG,John Tortorella,1,7,25,13,2,1,50.9,5,3
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
15 changes: 15 additions & 0 deletions data/games_dummy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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
15 changes: 15 additions & 0 deletions data/teams_dummy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
team_id,franchiseId,teamName,abbreviation,Stadium,link
1,23,Atlanta United,ATL,Mercedes-Benz Stadium,/api/v1/teams/1
4,16,Chicago Fire,CHI,SeatGeek Stadium,/api/v1/teams/4
26,14,FC Cincinnati,CIN,Nippert Stadium,/api/v1/teams/26
14,31,DC United,DC,Audi Field,/api/v1/teams/14
6,6,FC Dallas,DAL,Toyota Stadium,/api/v1/teams/6
3,10,Houston Dynamo,HOU,BBVA Stadium,/api/v1/teams/3
5,17,Sporting Kansas City,SKC,Children's Mercy Park,/api/v1/teams/5
17,12,LA Galaxy,LA,Dignity Health Sports Park,/api/v1/teams/17
28,29,Los Angeles FC,LFC,Banc of California Stadium,/api/v1/teams/28
18,34,Minnesota United FC,MIN,Allianz Field,/api/v1/teams/18
23,20,Montreal Impact,MTL,Saputo Stadium,/api/v1/teams/23
16,11,New England Revolution,NE,Gillette Stadium,/api/v1/teams/16
9,30,New York City FC,NYC,Yankee Stadium,/api/v1/teams/9
8,1,New York Red Bulls,NY,Red Bull Arena,/api/v1/teams/8
28 changes: 28 additions & 0 deletions lib/game.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Game
attr_reader :game_id,
:season,
:type,
:date_time,
:away_team_id,
:home_team_id,
:away_goals,
:home_goals,
:venue

def initialize(data)
@game_id = data[:game_id].to_i
@season = data[:season].to_i
@type = data[:type]
@date_time = data[:date_time] #NEED TO CONVERT TO DATE OBJECT
@away_team_id = data[:away_team_id].to_i
@home_team_id = data[:home_team_id].to_i
@away_goals = data[:away_goals].to_i
@home_goals = data[:home_goals].to_i
@venue = data[:venue]
end

def total_goals
@away_goals + @home_goals
end

end
36 changes: 36 additions & 0 deletions lib/season.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Season

attr_reader :game_id,
:team_id,
:hoa,
:result,
:settled_in,
:head_coach,
:goals,
:shots,
:tackles,
:pim,
:power_play_opportunities,
:power_play_goals,
:face_off_win_percentage,
:giveaways,
:takeaways

def initialize(data)
@game_id = data[:game_id].to_i
@team_id = data[:team_id].to_i
@hoa = data[:hoa]
@result = data[:result]
@settled_in = data[:settled_in]
@head_coach = data[:head_coach]
@goals = data[:goals].to_i
@shots = data[:shots].to_i
@tackles = data[:tackles].to_i
@pim = data[:pim].to_i
@power_play_opportunities = data[:powerplayopportunities].to_i
@power_play_goals = data[:powerplaygoals].to_i
@face_off_win_percentage = data[:faceoffwinpercentage].to_i
@giveaways = data[:giveaways].to_i
@takeaways = data[:takeaways].to_i
end
end
Loading