fantasydata 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.travis.yml +3 -0
- data/README.md +15 -1
- data/lib/fantasydata.rb +4 -0
- data/lib/fantasydata/api/injury.rb +18 -0
- data/lib/fantasydata/api/player_stat.rb +24 -0
- data/lib/fantasydata/api/season.rb +22 -0
- data/lib/fantasydata/api/team.rb +8 -0
- data/lib/fantasydata/api/timeline.rb +31 -0
- data/lib/fantasydata/api/week.rb +4 -4
- data/lib/fantasydata/client.rb +8 -2
- data/lib/fantasydata/injury.rb +13 -0
- data/lib/fantasydata/team_game_stat.rb +103 -0
- data/lib/fantasydata/team_season_stat.rb +84 -0
- data/lib/fantasydata/timeline.rb +12 -0
- data/lib/fantasydata/version.rb +1 -1
- data/spec/fantasydata/api/injury_spec.rb +54 -0
- data/spec/fantasydata/api/player_stat_spec.rb +121 -0
- data/spec/fantasydata/api/season_spec.rb +69 -0
- data/spec/fantasydata/api/team_spec.rb +43 -2
- data/spec/fantasydata/api/timeline_spec.rb +96 -0
- data/spec/fantasydata/api/week_spec.rb +13 -13
- data/spec/fixtures/injury/by_team.json +1 -0
- data/spec/fixtures/injury/by_year_and_week.json +1 -0
- data/spec/fixtures/player_stat/season_stat_by_player_id.json +1 -0
- data/spec/fixtures/player_stat/season_stat_by_player_id_projection.json +1 -0
- data/spec/fixtures/player_stat/season_stat_by_season_projection.json +1 -0
- data/spec/fixtures/player_stat/season_stat_by_team.json +1 -0
- data/spec/fixtures/player_stat/season_stat_by_team_projection.json +1 -0
- data/spec/fixtures/season/current.json +1 -0
- data/spec/fixtures/season/last_completed.json +1 -0
- data/spec/fixtures/season/upcoming.json +1 -0
- data/spec/fixtures/team/season_stats.json +1 -0
- data/spec/fixtures/team/week_stats.json +1 -0
- data/spec/fixtures/timeline/all.json +1 -0
- data/spec/fixtures/timeline/completed.json +1 -0
- data/spec/fixtures/timeline/current.json +1 -0
- data/spec/fixtures/timeline/recent.json +1 -0
- data/spec/fixtures/timeline/upcoming.json +1 -0
- metadata +60 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 068bbd920761d11f6074947e253393d8913ebf42
|
4
|
+
data.tar.gz: 53bf5b17a32c7eb90e955fc048974914abc33fd4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 99a0b95194675a4405e969515ae0d9188383511d49eba1e3bd79b0005ade74ad89d79dd4105acaa8ed3091306db329843d794b2ae98619844551081824dd4399
|
7
|
+
data.tar.gz: 33a612732f744ced12478815941473ef7188c0e49605d2c0e7a970c0526df0966818debba217be4601e024cffdc52c122d67550392f0721e20c55392ca16a93f
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,23 @@
|
|
1
1
|
# Fantasydata
|
2
2
|
|
3
|
+
Check https://github.com/Drosty/fantasydata/wiki/Checklist for status on completed and incomplete endpoints.
|
4
|
+
|
3
5
|
[](https://travis-ci.org/Drosty/fantasydata)[](https://codeclimate.com/github/Drosty/fantasydata)[](https://codeclimate.com/github/Drosty/fantasydata/coverage)
|
4
6
|
|
5
7
|
|
6
|
-
|
8
|
+
A Ruby interface to the Fantasy Data API. The Fantasy Data API delivery historical and up to the second NFL, NBA and MLB data. This gem currently only supports the NFL Data but could be expanded to include the others as well. Details about the API can be found here: https://developer.fantasydata.com/documentation
|
9
|
+
|
10
|
+
## Inspiration
|
11
|
+
I relied heavily on the [Echowrap](https://github.com/timcase/echowrap) gem to follow best practices around the structure of the gem, tests and documentation.
|
12
|
+
|
13
|
+
## Supported Rubies
|
14
|
+
|
15
|
+
## Gem Dependencies
|
16
|
+
|
17
|
+
Installing this gem also installs the following gems:
|
18
|
+
|
19
|
+
- [faraday](https://github.com/lostisland/faraday) HTTP client lib that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle.
|
20
|
+
- [multi_json](https://github.com/intridea/multi_json) A common interface to multiple JSON libraries, including Oj, Yajl, the JSON gem (with C-extensions), the pure-Ruby JSON gem, NSJSONSerialization, gson.rb, JrJackson, and OkJson.
|
7
21
|
|
8
22
|
## Installation
|
9
23
|
|
data/lib/fantasydata.rb
CHANGED
@@ -5,6 +5,7 @@ require 'fantasydata/bye_week'
|
|
5
5
|
require 'fantasydata/fantasy_player_adp'
|
6
6
|
require 'fantasydata/daily_fantasy_player'
|
7
7
|
require 'fantasydata/daily_fantasy_points'
|
8
|
+
require 'fantasydata/injury'
|
8
9
|
require 'fantasydata/news'
|
9
10
|
require 'fantasydata/player_detail'
|
10
11
|
require 'fantasydata/player_game_stat'
|
@@ -15,6 +16,9 @@ require 'fantasydata/schedule'
|
|
15
16
|
require 'fantasydata/team_detail'
|
16
17
|
require 'fantasydata/stadium'
|
17
18
|
require 'fantasydata/standings'
|
19
|
+
require 'fantasydata/timeline'
|
20
|
+
require 'fantasydata/team_game_stat'
|
21
|
+
require 'fantasydata/team_season_stat'
|
18
22
|
require 'fantasydata/error'
|
19
23
|
require 'fantasydata/version'
|
20
24
|
require 'fantasydata/daily_fantasy_player_stats'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'fantasydata/api/utils'
|
2
|
+
|
3
|
+
module Fantasydata
|
4
|
+
module API
|
5
|
+
module Injury
|
6
|
+
include Fantasydata::API::Utils
|
7
|
+
|
8
|
+
def injuries_by_year_and_week year, week
|
9
|
+
objects_from_response(Fantasydata::Injury, :get, "/nfl/v2/JSON/Injuries/#{year}/#{week}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def injuries_by_year_week_team year, week, team
|
13
|
+
objects_from_response(Fantasydata::Injury, :get, "/nfl/v2/JSON/Injuries/#{year}/#{week}/#{team}")
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -28,6 +28,30 @@ module Fantasydata
|
|
28
28
|
def player_game_stats_by_delta minutes
|
29
29
|
objects_from_response(Fantasydata::PlayerGameStat, :get, "/nfl/v2/JSON/PlayerGameStatsDelta/#{minutes}")
|
30
30
|
end
|
31
|
+
|
32
|
+
def player_season_stats_by_year_projection year
|
33
|
+
objects_from_response(Fantasydata::PlayerSeasonStat, :get, "/nfl/v2/JSON/PlayerSeasonProjectionStats/#{year}")
|
34
|
+
end
|
35
|
+
|
36
|
+
def player_season_stat_by_player_id year, player_id
|
37
|
+
# This endpoint returns an array - but there will always only be one.
|
38
|
+
# API will just return the first one to have the object and not an array
|
39
|
+
items = objects_from_response(Fantasydata::PlayerSeasonStat, :get, "/nfl/v2/JSON/PlayerSeasonStatsByPlayerID/#{year}/#{player_id}")
|
40
|
+
items.first
|
41
|
+
end
|
42
|
+
|
43
|
+
def player_season_stat_by_player_id_projection year, player_id
|
44
|
+
object_from_response(Fantasydata::PlayerSeasonStat, :get, "/nfl/v2/JSON/PlayerSeasonProjectionStatsByPlayerID/#{year}/#{player_id}")
|
45
|
+
end
|
46
|
+
|
47
|
+
def player_season_stat_by_team year, team
|
48
|
+
objects_from_response(Fantasydata::PlayerSeasonStat, :get, "/nfl/v2/JSON/PlayerSeasonStatsByTeam/#{year}/#{team}")
|
49
|
+
end
|
50
|
+
|
51
|
+
def player_season_stat_by_team_projection year, team
|
52
|
+
objects_from_response(Fantasydata::PlayerSeasonStat, :get, "/nfl/v2/JSON/PlayerSeasonProjectionStatsByTeam/#{year}/#{team}")
|
53
|
+
end
|
54
|
+
|
31
55
|
end
|
32
56
|
end
|
33
57
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fantasydata/api/utils'
|
2
|
+
|
3
|
+
module Fantasydata
|
4
|
+
module API
|
5
|
+
module Season
|
6
|
+
include Fantasydata::API::Utils
|
7
|
+
|
8
|
+
def current_season
|
9
|
+
integer_from_response(:get, '/nfl/v2/JSON/CurrentSeason')
|
10
|
+
end
|
11
|
+
|
12
|
+
def last_completed_season
|
13
|
+
integer_from_response(:get, '/nfl/v2/JSON/LastCompletedSeason')
|
14
|
+
end
|
15
|
+
|
16
|
+
def upcoming_season
|
17
|
+
integer_from_response(:get, '/nfl/v2/JSON/UpcomingSeason')
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/fantasydata/api/team.rb
CHANGED
@@ -13,6 +13,14 @@ module Fantasydata
|
|
13
13
|
objects_from_response(Fantasydata::TeamDetail, :get, "/nfl/v2/JSON/Teams/#{year}")
|
14
14
|
end
|
15
15
|
|
16
|
+
def team_game_stats_by_year_and_week year, week
|
17
|
+
objects_from_response(Fantasydata::TeamGameStat, :get, "nfl/v2/JSON/TeamGameStats/#{year}/#{week}")
|
18
|
+
end
|
19
|
+
|
20
|
+
def team_game_stats_by_season year
|
21
|
+
objects_from_response(Fantasydata::TeamSeasonStat, :get, "nfl/v2/JSON/TeamSeasonStats/#{year}")
|
22
|
+
end
|
23
|
+
|
16
24
|
end
|
17
25
|
end
|
18
26
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'fantasydata/api/utils'
|
2
|
+
|
3
|
+
module Fantasydata
|
4
|
+
module API
|
5
|
+
module Timeline
|
6
|
+
include Fantasydata::API::Utils
|
7
|
+
|
8
|
+
def current_timeline
|
9
|
+
objects = objects_from_response(Fantasydata::Timeline, :get, "/nfl/v2/JSON/Timeframes/current")
|
10
|
+
objects.first
|
11
|
+
end
|
12
|
+
|
13
|
+
def upcoming_timelines
|
14
|
+
objects = objects_from_response(Fantasydata::Timeline, :get, "/nfl/v2/JSON/Timeframes/upcoming")
|
15
|
+
end
|
16
|
+
|
17
|
+
def completed_timelines
|
18
|
+
objects = objects_from_response(Fantasydata::Timeline, :get, "/nfl/v2/JSON/Timeframes/completed")
|
19
|
+
end
|
20
|
+
|
21
|
+
def recent_timelines
|
22
|
+
objects = objects_from_response(Fantasydata::Timeline, :get, "/nfl/v2/JSON/Timeframes/recent")
|
23
|
+
end
|
24
|
+
|
25
|
+
def all_timelines
|
26
|
+
objects = objects_from_response(Fantasydata::Timeline, :get, "/nfl/v2/JSON/Timeframes/all")
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/fantasydata/api/week.rb
CHANGED
@@ -5,16 +5,16 @@ module Fantasydata
|
|
5
5
|
module Week
|
6
6
|
include Fantasydata::API::Utils
|
7
7
|
|
8
|
-
def
|
8
|
+
def current_week
|
9
9
|
integer_from_response(:get, '/nfl/v2/JSON/CurrentWeek')
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def last_completed_week
|
13
13
|
integer_from_response(:get, '/nfl/v2/JSON/LastCompletedWeek')
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
integer_from_response(:get, '/nfl/v2/
|
16
|
+
def upcoming_week
|
17
|
+
integer_from_response(:get, '/nfl/v2/JSON/UpcomingWeek')
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
data/lib/fantasydata/client.rb
CHANGED
@@ -5,14 +5,17 @@ require 'fantasydata/api/game'
|
|
5
5
|
require 'fantasydata/api/box_score'
|
6
6
|
require 'fantasydata/api/bye_weeks'
|
7
7
|
require 'fantasydata/api/player_details'
|
8
|
+
require 'fantasydata/api/fantasy'
|
9
|
+
require 'fantasydata/api/injury'
|
8
10
|
require 'fantasydata/api/news'
|
9
11
|
require 'fantasydata/api/week'
|
10
12
|
require 'fantasydata/api/team'
|
13
|
+
require 'fantasydata/api/player_stat'
|
11
14
|
require 'fantasydata/api/schedule'
|
15
|
+
require 'fantasydata/api/season'
|
12
16
|
require 'fantasydata/api/stadium'
|
13
17
|
require 'fantasydata/api/standings'
|
14
|
-
require 'fantasydata/api/
|
15
|
-
require 'fantasydata/api/fantasy'
|
18
|
+
require 'fantasydata/api/timeline'
|
16
19
|
|
17
20
|
module Fantasydata
|
18
21
|
class Client
|
@@ -20,13 +23,16 @@ module Fantasydata
|
|
20
23
|
include Fantasydata::API::ByeWeeks
|
21
24
|
include Fantasydata::API::BoxScore
|
22
25
|
include Fantasydata::API::Fantasy
|
26
|
+
include Fantasydata::API::Injury
|
23
27
|
include Fantasydata::API::News
|
24
28
|
include Fantasydata::API::PlayerDetails
|
25
29
|
include Fantasydata::API::PlayerStat
|
26
30
|
include Fantasydata::API::Team
|
31
|
+
include Fantasydata::API::Season
|
27
32
|
include Fantasydata::API::Schedule
|
28
33
|
include Fantasydata::API::Stadium
|
29
34
|
include Fantasydata::API::Standings
|
35
|
+
include Fantasydata::API::Timeline
|
30
36
|
include Fantasydata::API::Week
|
31
37
|
include Fantasydata::Configurable
|
32
38
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'fantasydata/base'
|
2
|
+
|
3
|
+
module Fantasydata
|
4
|
+
class Injury < Fantasydata::Base
|
5
|
+
attr_reader :injury_id, :season_type, :season, :week,
|
6
|
+
:player_id, :name, :position, :number, :team,
|
7
|
+
:opponent, :body_part, :status, :practice,
|
8
|
+
:practice_description, :updated, :declared_inactive
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require 'fantasydata/base'
|
2
|
+
|
3
|
+
module Fantasydata
|
4
|
+
class TeamGameStat < Fantasydata::Base
|
5
|
+
attr_reader :game_key, :date, :season_type, :season, :week,
|
6
|
+
:team, :opponent, :home_or_away, :score, :opponent_score,
|
7
|
+
:total_score, :stadium, :playing_surface, :temperature,
|
8
|
+
:humidity, :wind_speed, :over_under, :point_spread,
|
9
|
+
:score_quarter1, :score_quarter2, :score_quarter3,
|
10
|
+
:score_quarter4, :score_overtime,
|
11
|
+
:time_of_possession_minutes, :time_of_possession_seconds,
|
12
|
+
:time_of_possession, :first_downs, :first_downs_by_rushing,
|
13
|
+
:first_downs_by_passing, :first_downs_by_penalty,
|
14
|
+
:offensive_plays, :offensive_yards, :offensive_yards_per_play,
|
15
|
+
:touchdowns, :rushing_attempts, :rushing_yards,
|
16
|
+
:rushing_yards_per_attempt, :rushing_touchdowns,
|
17
|
+
:passing_attempts, :passing_completions, :passing_yards,
|
18
|
+
:passing_touchdowns, :passing_interceptions,
|
19
|
+
:passing_yards_per_attempt, :passing_yards_per_completion,
|
20
|
+
:completion_percentage, :passer_rating, :third_down_attempts,
|
21
|
+
:third_down_conversions, :third_down_percentage,
|
22
|
+
:fourth_down_attempts, :fourth_down_conversions,
|
23
|
+
:fourth_down_percentage, :red_zone_attempts,
|
24
|
+
:red_zone_conversions, :goal_to_go_attempts,
|
25
|
+
:goal_to_go_conversions, :return_yards, :penalties, :penalty_yards,
|
26
|
+
:fumbles, :fumbles_lost, :times_sacked, :times_sacked_yards,
|
27
|
+
:quarterback_hits, :tackles_for_loss, :safeties, :punts, :punt_yards,
|
28
|
+
:punt_average, :giveaways, :takeaways, :turnover_differential,
|
29
|
+
:opponent_score_quarter1, :opponent_score_quarter2,
|
30
|
+
:opponent_score_quarter3, :opponent_score_quarter4,
|
31
|
+
:opponent_score_overtime, :opponent_time_of_possession_minutes,
|
32
|
+
:opponent_time_of_possession_seconds, :opponent_time_of_possession,
|
33
|
+
:opponent_first_downs, :opponent_first_downs_by_rushing,
|
34
|
+
:opponent_first_downs_by_passing, :opponent_first_downs_by_penalty,
|
35
|
+
:opponent_offensive_plays, :opponent_offensive_yards,
|
36
|
+
:opponent_offensive_yards_per_play, :opponent_touchdowns,
|
37
|
+
:opponent_rushing_attempts, :opponent_rushing_yards,
|
38
|
+
:opponent_rushing_yards_per_attempt, :opponent_rushing_touchdowns,
|
39
|
+
:opponent_passing_attempts, :opponent_passing_completions,
|
40
|
+
:opponent_passing_yards, :opponent_passing_touchdowns,
|
41
|
+
:opponent_passing_interceptions, :opponent_passing_yards_per_attempt,
|
42
|
+
:opponent_passing_yards_per_completion, :opponent_completion_percentage,
|
43
|
+
:opponent_passer_rating, :opponent_third_down_attempts,
|
44
|
+
:opponent_third_down_conversions, :opponent_third_down_percentage,
|
45
|
+
:opponent_fourth_down_attempts, :opponent_fourth_down_conversions,
|
46
|
+
:opponent_fourth_down_percentage, :opponent_red_zone_attempts,
|
47
|
+
:opponent_red_zone_conversions, :opponent_goal_to_go_attempts,
|
48
|
+
:opponent_goal_to_go_conversions, :opponent_return_yards,
|
49
|
+
:opponent_penalties, :opponent_penalty_yards, :opponent_fumbles,
|
50
|
+
:opponent_fumbles_lost, :opponent_times_sacked,
|
51
|
+
:opponent_times_sacked_yards, :opponent_quarterback_hits,
|
52
|
+
:opponent_tackles_for_loss, :opponent_safeties, :opponent_punts,
|
53
|
+
:opponent_punt_yards, :opponent_punt_average, :opponent_giveaways,
|
54
|
+
:opponent_takeaways, :opponent_turnover_differential,
|
55
|
+
:red_zone_percentage, :goal_to_go_percentage,
|
56
|
+
:quarterback_hits_differential, :tackles_for_loss_differential,
|
57
|
+
:quarterback_sacks_differential, :tackles_for_loss_percentage,
|
58
|
+
:quarterback_hits_percentage, :times_sacked_percentage,
|
59
|
+
:opponent_red_zone_percentage, :opponent_goal_to_go_percentage,
|
60
|
+
:opponent_quarterback_hits_differential,
|
61
|
+
:opponent_tackles_for_loss_differential,
|
62
|
+
:opponent_quarterback_sacks_differential,
|
63
|
+
:opponent_tackles_for_loss_percentage,
|
64
|
+
:opponent_quarterback_hits_percentage, :opponent_times_sacked_percentage,
|
65
|
+
:kickoffs, :kickoffs_in_end_zone, :kickoff_touchbacks, :punts_had_blocked,
|
66
|
+
:punt_net_average, :extra_point_kicking_attempts,
|
67
|
+
:extra_point_kicking_conversions, :extra_points_had_blocked,
|
68
|
+
:extra_point_passing_attempts, :extra_point_passing_conversions,
|
69
|
+
:extra_point_rushing_attempts, :extra_point_rushing_conversions,
|
70
|
+
:field_goal_attempts, :field_goals_made, :field_goals_had_blocked,
|
71
|
+
:punt_returns, :punt_return_yards, :kick_returns, :kick_return_yards,
|
72
|
+
:interception_returns, :interception_return_yards, :opponent_kickoffs,
|
73
|
+
:opponent_kickoffs_in_end_zone, :opponent_kickoff_touchbacks,
|
74
|
+
:opponent_punts_had_blocked, :opponent_punt_net_average,
|
75
|
+
:opponent_extra_point_kicking_attempts, :opponent_extra_point_kicking_conversions,
|
76
|
+
:opponent_extra_points_had_blocked, :opponent_extra_point_passing_attempts,
|
77
|
+
:opponent_extra_point_passing_conversions, :opponent_extra_point_rushing_attempts,
|
78
|
+
:opponent_extra_point_rushing_conversions,
|
79
|
+
:opponent_field_goal_attempts, :opponent_field_goals_made,
|
80
|
+
:opponent_field_goals_had_blocked, :opponent_punt_returns,
|
81
|
+
:opponent_punt_return_yards, :opponent_kick_returns,
|
82
|
+
:opponent_kick_return_yards, :opponent_interception_returns,
|
83
|
+
:opponent_interception_return_yards, :solo_tackles, :assisted_tackles, :sacks,
|
84
|
+
:sack_yards, :passes_defended, :fumbles_forced, :fumbles_recovered,
|
85
|
+
:fumble_return_yards, :fumble_return_touchdowns, :interception_return_touchdowns,
|
86
|
+
:blocked_kicks, :punt_return_touchdowns, :punt_return_long,
|
87
|
+
:kick_return_touchdowns, :kick_return_long, :blocked_kick_return_yards,
|
88
|
+
:blocked_kick_return_touchdowns, :field_goal_return_yards,
|
89
|
+
:field_goal_return_touchdowns, :punt_net_yards, :opponent_solo_tackles,
|
90
|
+
:opponent_assisted_tackles, :opponent_sacks, :opponent_sack_yards,
|
91
|
+
:opponent_passes_defended, :opponent_fumbles_forced, :opponent_fumbles_recovered,
|
92
|
+
:opponent_fumble_return_yards, :opponent_fumble_return_touchdowns,
|
93
|
+
:opponent_interception_return_touchdowns, :opponent_blocked_kicks,
|
94
|
+
:opponent_punt_return_touchdowns, :opponent_punt_return_long,
|
95
|
+
:opponent_kick_return_touchdowns, :opponent_kick_return_long,
|
96
|
+
:opponent_blocked_kick_return_yards, :opponent_blocked_kick_return_touchdowns,
|
97
|
+
:opponent_field_goal_return_yards, :opponent_field_goal_return_touchdowns,
|
98
|
+
:opponent_punt_net_yards, :is_game_over, :team_name, :day_of_week,
|
99
|
+
:passing_dropbacks, :opponent_passing_dropbacks, :team_game_id,
|
100
|
+
:two_point_conversion_returns, :opponent_two_point_conversion_returns
|
101
|
+
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'fantasydata/base'
|
2
|
+
|
3
|
+
module Fantasydata
|
4
|
+
class TeamSeasonStat < Fantasydata::Base
|
5
|
+
attr_reader :season_type, :season, :team, :score, :opponent_score, :total_score,
|
6
|
+
:temperature, :humidity, :wind_speed, :over_under, :point_spread, :score_quarter1,
|
7
|
+
:score_quarter2, :score_quarter3, :score_quarter4, :score_overtime,
|
8
|
+
:time_of_possession, :first_downs, :first_downs_by_rushing, :first_downs_by_passing,
|
9
|
+
:first_downs_by_penalty, :offensive_plays, :offensive_yards, :offensive_yards_per_play,
|
10
|
+
:touchdowns, :rushing_attempts, :rushing_yards, :rushing_yards_per_attempt,
|
11
|
+
:rushing_touchdowns, :passing_attempts, :passing_completions, :passing_yards,
|
12
|
+
:passing_touchdowns, :passing_interceptions, :passing_yards_per_attempt,
|
13
|
+
:passing_yards_per_completion, :completion_percentage, :passer_rating,
|
14
|
+
:third_down_attempts, :third_down_conversions, :third_down_percentage,
|
15
|
+
:fourth_down_attempts, :fourth_down_conversions, :fourth_down_percentage,
|
16
|
+
:red_zone_attempts, :red_zone_conversions, :goal_to_go_attempts, :goal_to_go_conversions,
|
17
|
+
:return_yards, :penalties, :penalty_yards, :fumbles, :fumbles_lost, :times_sacked,
|
18
|
+
:times_sacked_yards, :quarterback_hits, :tackles_for_loss, :safeties, :punts,
|
19
|
+
:punt_yards, :punt_average, :giveaways, :takeaways, :turnover_differential,
|
20
|
+
:opponent_score_quarter1, :opponent_score_quarter2, :opponent_score_quarter3,
|
21
|
+
:opponent_score_quarter4, :opponent_score_overtime, :opponent_time_of_possession,
|
22
|
+
:opponent_first_downs, :opponent_first_downs_by_rushing,
|
23
|
+
:opponent_first_downs_by_passing, :opponent_first_downs_by_penalty,
|
24
|
+
:opponent_offensive_plays, :opponent_offensive_yards, :opponent_offensive_yards_per_play,
|
25
|
+
:opponent_touchdowns, :opponent_rushing_attempts, :opponent_rushing_yards,
|
26
|
+
:opponent_rushing_yards_per_attempt, :opponent_rushing_touchdowns,
|
27
|
+
:opponent_passing_attempts, :opponent_passing_completions, :opponent_passing_yards,
|
28
|
+
:opponent_passing_touchdowns, :opponent_passing_interceptions,
|
29
|
+
:opponent_passing_yards_per_attempt, :opponent_passing_yards_per_completion,
|
30
|
+
:opponent_completion_percentage, :opponent_passer_rating, :opponent_third_down_attempts,
|
31
|
+
:opponent_third_down_conversions, :opponent_third_down_percentage,
|
32
|
+
:opponent_fourth_down_attempts, :opponent_fourth_down_conversions,
|
33
|
+
:opponent_fourth_down_percentage, :opponent_red_zone_attempts,
|
34
|
+
:opponent_red_zone_conversions, :opponent_goal_to_go_attempts,
|
35
|
+
:opponent_goal_to_go_conversions, :opponent_return_yards, :opponent_penalties,
|
36
|
+
:opponent_penalty_yards, :opponent_fumbles, :opponent_fumbles_lost,
|
37
|
+
:opponent_times_sacked, :opponent_times_sacked_yards, :opponent_quarterback_hits,
|
38
|
+
:opponent_tackles_for_loss, :opponent_safeties, :opponent_punts,
|
39
|
+
:opponent_punt_yards, :opponent_punt_average, :opponent_giveaways,
|
40
|
+
:opponent_takeaways, :opponent_turnover_differential, :red_zone_percentage,
|
41
|
+
:goal_to_go_percentage, :quarterback_hits_differential,
|
42
|
+
:tackles_for_loss_differential, :quarterback_sacks_differential,
|
43
|
+
:tackles_for_loss_percentage, :quarterback_hits_percentage,
|
44
|
+
:times_sacked_percentage, :opponent_red_zone_percentage,
|
45
|
+
:opponent_goal_to_go_percentage, :opponent_quarterback_hits_differential,
|
46
|
+
:opponent_tackles_for_loss_differential, :opponent_quarterback_sacks_differential,
|
47
|
+
:opponent_tackles_for_loss_percentage, :opponent_quarterback_hits_percentage,
|
48
|
+
:opponent_times_sacked_percentage, :kickoffs, :kickoffs_in_end_zone,
|
49
|
+
:kickoff_touchbacks, :punts_had_blocked, :punt_net_average,
|
50
|
+
:extra_point_kicking_attempts, :extra_point_kicking_conversions,
|
51
|
+
:extra_points_had_blocked, :extra_point_passing_attempts,
|
52
|
+
:extra_point_passing_conversions, :extra_point_rushing_attempts,
|
53
|
+
:extra_point_rushing_conversions, :field_goal_attempts, :field_goals_made,
|
54
|
+
:field_goals_had_blocked, :punt_returns, :punt_return_yards, :kick_returns,
|
55
|
+
:kick_return_yards, :interception_returns, :interception_return_yards,
|
56
|
+
:opponent_kickoffs, :opponent_kickoffs_in_end_zone, :opponent_kickoff_touchbacks,
|
57
|
+
:opponent_punts_had_blocked, :opponent_punt_net_average,
|
58
|
+
:opponent_extra_point_kicking_attempts, :opponent_extra_point_kicking_conversions,
|
59
|
+
:opponent_extra_points_had_blocked, :opponent_extra_point_passing_attempts,
|
60
|
+
:opponent_extra_point_passing_conversions, :opponent_extra_point_rushing_attempts,
|
61
|
+
:opponent_extra_point_rushing_conversions, :opponent_field_goal_attempts,
|
62
|
+
:opponent_field_goals_made, :opponent_field_goals_had_blocked, :opponent_punt_returns,
|
63
|
+
:opponent_punt_return_yards, :opponent_kick_returns, :opponent_kick_return_yards,
|
64
|
+
:opponent_interception_returns, :opponent_interception_return_yards, :solo_tackles,
|
65
|
+
:assisted_tackles, :sacks, :sack_yards, :passes_defended, :fumbles_forced,
|
66
|
+
:fumbles_recovered, :fumble_return_yards, :fumble_return_touchdowns,
|
67
|
+
:interception_return_touchdowns, :blocked_kicks, :punt_return_touchdowns,
|
68
|
+
:punt_return_long, :kick_return_touchdowns, :kick_return_long,
|
69
|
+
:blocked_kick_return_yards, :blocked_kick_return_touchdowns, :field_goal_return_yards,
|
70
|
+
:field_goal_return_touchdowns, :punt_net_yards, :opponent_solo_tackles,
|
71
|
+
:opponent_assisted_tackles, :opponent_sacks, :opponent_sack_yards,
|
72
|
+
:opponent_passes_defended, :opponent_fumbles_forced, :opponent_fumbles_recovered,
|
73
|
+
:opponent_fumble_return_yards, :opponent_fumble_return_touchdowns,
|
74
|
+
:opponent_interception_return_touchdowns, :opponent_blocked_kicks,
|
75
|
+
:opponent_punt_return_touchdowns, :opponent_punt_return_long,
|
76
|
+
:opponent_kick_return_touchdowns, :opponent_kick_return_long,
|
77
|
+
:opponent_blocked_kick_return_yards, :opponent_blocked_kick_return_touchdowns,
|
78
|
+
:opponent_field_goal_return_yards, :opponent_field_goal_return_touchdowns,
|
79
|
+
:opponent_punt_net_yards, :team_name, :games, :passing_dropbacks,
|
80
|
+
:opponent_passing_dropbacks, :team_season_id, :two_point_conversion_returns,
|
81
|
+
:opponent_two_point_conversion_returns
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|