Class: Player
Class Method Summary collapse
-
.all ⇒ Object
returns daily fantasy players with salaries by ADP.
-
.daily_players ⇒ Object
returns players and projections for the current week.
-
.fantasy_points(options = {}) ⇒ Object
returns players and points scored for the week.
-
.inactive ⇒ Object
returns inactive players.
-
.injuries(week) ⇒ Object
returns players with injuries.
-
.news(id) ⇒ Object
returns news about a player.
-
.player_projections_by_game(id, week) ⇒ Object
returns player projections by game.
-
.player_projections_by_player(id) ⇒ Object
returns player projections by player.
-
.player_projections_by_season ⇒ Object
returns player projections for season.
-
.point_leaders(position, type) ⇒ Object
returns league leaders in fantasy points based on position.
-
.point_leaders_by_week(position, week) ⇒ Object
retuns league leaders by week in fantasy points by position.
-
.recent_news ⇒ Object
returns recent news.
Methods included from API::Request
base_url, build_url, headers, request_service
Class Method Details
.all ⇒ Object
returns daily fantasy players with salaries by ADP
7 8 9 |
# File 'lib/player.rb', line 7 def self.all request_service('FantasyPlayers') end |
.daily_players ⇒ Object
returns players and projections for the current week
34 35 36 |
# File 'lib/player.rb', line 34 def self.daily_players request_service('DailyFantasyPlayers', CoreExtensions::Fantasy::Date.current_date) end |
.fantasy_points(options = {}) ⇒ Object
returns players and points scored for the week
39 40 41 |
# File 'lib/player.rb', line 39 def self.fantasy_points = {} request_service('DailyFantasyPoints', CoreExtensions::Fantasy::Date.current_date) end |
.inactive ⇒ Object
returns inactive players
19 20 21 |
# File 'lib/player.rb', line 19 def self.inactive self.injuries(5).select { |player| player['DeclaredInactive'] if player['DeclaredInactive'] == true} end |
.injuries(week) ⇒ Object
returns players with injuries
14 15 16 |
# File 'lib/player.rb', line 14 def self.injuries week request_service('Injuries', [CoreExtensions::Fantasy::Date.last_season, week]) end |
.news(id) ⇒ Object
returns news about a player
24 25 26 |
# File 'lib/player.rb', line 24 def self.news id request_service('NewsByPlayerID', id) end |
.player_projections_by_game(id, week) ⇒ Object
returns player projections by game
54 55 56 |
# File 'lib/player.rb', line 54 def self.player_projections_by_game id, week request_service('PlayerGameProjectionStatsByPlayerID', [CoreExtensions::Fantasy::Date.last_season, week, id]) end |
.player_projections_by_player(id) ⇒ Object
returns player projections by player
64 65 66 |
# File 'lib/player.rb', line 64 def self.player_projections_by_player id request_service('PlayerSeasonProjectionStatsByPlayerID', [CoreExtensions::Fantasy::Date.regular_season, id]) end |
.player_projections_by_season ⇒ Object
returns player projections for season
59 60 61 |
# File 'lib/player.rb', line 59 def self.player_projections_by_season request_service('PlayerSeasonProjectionStats', CoreExtensions::Fantasy::Date.regular_season) end |
.point_leaders(position, type) ⇒ Object
returns league leaders in fantasy points based on position
44 45 46 |
# File 'lib/player.rb', line 44 def self.point_leaders position, type request_service('SeasonLeagueLeaders', [CoreExtensions::Fantasy::Date.last_season, position, type]) end |
.point_leaders_by_week(position, week) ⇒ Object
retuns league leaders by week in fantasy points by position
49 50 51 |
# File 'lib/player.rb', line 49 def self.point_leaders_by_week position, week request_service('GameLeagueLeaders', [CoreExtensions::Fantasy::Date.last_season, week, position, 'FantasyPoints']) end |
.recent_news ⇒ Object
returns recent news
29 30 31 |
# File 'lib/player.rb', line 29 def self.recent_news request_service('News') end |