Class: YFantasy::Player
- Inherits:
-
BaseResource
- Object
- BaseResource
- YFantasy::Player
- Defined in:
- lib/y_fantasy/resources/player.rb,
lib/y_fantasy/resources/player/draft_analysis.rb,
lib/y_fantasy/resources/player/stat_collection.rb,
lib/y_fantasy/resources/player/ownership_percentage.rb
Overview
Represents a Yahoo Fantasy Player
Defined Under Namespace
Classes: DraftAnalysis, OwnershipPercentage, StatCollection
Instance Attribute Summary collapse
-
#bye_weeks ⇒ Array<String>?
readonly
The bye weeks for this player.
-
#display_position ⇒ String
readonly
The display position of the player.
-
#draft_analysis ⇒ DraftAnalysis?
readonly
The draft analysis for this player.
-
#editorial_player_key ⇒ String
readonly
The editorial key for this player.
-
#editorial_team_abbr ⇒ String
readonly
The abbreviation of the player’s real-life team.
-
#editorial_team_full_name ⇒ String
readonly
The full name of the player’s real-life team.
-
#editorial_team_key ⇒ String
readonly
The key of the player’s real-life team.
-
#editorial_team_url ⇒ String
readonly
The URL to the player’s real-life team page.
-
#eligible_positions ⇒ String+
readonly
The eligible positions for this player (e.g. “QB”, [“RB”, “WR”]).
-
#has_player_notes ⇒ Boolean?
readonly
Whether this player has notes.
-
#has_recent_player_notes ⇒ Boolean?
readonly
Whether this player has recent notes.
-
#headshot ⇒ Hash
readonly
Hash containing headshot information (size, url).
-
#image_url ⇒ String
readonly
The player’s image URL.
-
#is_keeper ⇒ Hash
readonly
A hash containing the player’s keeper status and cost.
-
#is_undroppable ⇒ Boolean
readonly
Whether this player is undroppable.
-
#name ⇒ Hash
readonly
Hash containing the player’s name (first, last, full, ascii_first, ascii_last).
-
#ownership_percentage ⇒ OwnershipPercentage?
readonly
The ownership percentage information for this player.
-
#player_id ⇒ Integer
readonly
The ID for this player.
-
#player_key ⇒ String
readonly
The unique key for this player, within a Game.
-
#player_notes_last_timestamp ⇒ Integer?
readonly
The timestamp of the last player note.
-
#player_points ⇒ Hash?
readonly
Hash containing details about the player’s fantasy points.
-
#position_type ⇒ String
readonly
The type of position (e.g. “O” for offense).
-
#selected_position ⇒ Hash?
readonly
Hash containing details about the player’s selected position.
-
#stats ⇒ StatCollection?
readonly
The stat collection for this player.
-
#uniform_number ⇒ String
readonly
The player’s uniform number.
-
#url ⇒ String
readonly
The URL to the player’s Yahoo Fantasy page.
Instance Method Summary collapse
-
#first_name ⇒ String
Returns the player’s first name.
-
#full_name ⇒ String
Returns the player’s full name.
-
#last_name ⇒ String
Returns the player’s last name.
Methods inherited from BaseResource
collection_name, dependent?, find, find_all, #key, resource_name
Methods included from Subresourceable
Instance Attribute Details
#bye_weeks ⇒ Array<String>? (readonly)
Returns the bye weeks for this player.
81 |
# File 'lib/y_fantasy/resources/player.rb', line 81 option :bye_weeks, optional: true, type: ->(h) { h[:week] } |
#display_position ⇒ String (readonly)
When a player has more than one position, this will be a comma-separated string of positions
Returns the display position of the player.
19 |
# File 'lib/y_fantasy/resources/player.rb', line 19 option :display_position |
#draft_analysis ⇒ DraftAnalysis? (readonly)
Returns the draft analysis for this player.
120 |
# File 'lib/y_fantasy/resources/player.rb', line 120 option :draft_analysis, optional: true, type: instance_of(DraftAnalysis) |
#editorial_player_key ⇒ String (readonly)
Returns the editorial key for this player.
23 |
# File 'lib/y_fantasy/resources/player.rb', line 23 option :editorial_player_key |
#editorial_team_abbr ⇒ String (readonly)
Returns the abbreviation of the player’s real-life team.
27 |
# File 'lib/y_fantasy/resources/player.rb', line 27 option :editorial_team_abbr |
#editorial_team_full_name ⇒ String (readonly)
Returns the full name of the player’s real-life team.
31 |
# File 'lib/y_fantasy/resources/player.rb', line 31 option :editorial_team_full_name |
#editorial_team_key ⇒ String (readonly)
Returns the key of the player’s real-life team.
35 |
# File 'lib/y_fantasy/resources/player.rb', line 35 option :editorial_team_key |
#editorial_team_url ⇒ String (readonly)
Returns the URL to the player’s real-life team page.
39 |
# File 'lib/y_fantasy/resources/player.rb', line 39 option :editorial_team_url |
#eligible_positions ⇒ String+ (readonly)
Returns the eligible positions for this player (e.g. “QB”, [“RB”, “WR”]).
43 |
# File 'lib/y_fantasy/resources/player.rb', line 43 option :eligible_positions, type: ->(h) { h[:position] } |
#has_player_notes ⇒ Boolean? (readonly)
Returns whether this player has notes.
85 |
# File 'lib/y_fantasy/resources/player.rb', line 85 option :has_player_notes, optional: true, type: Types::Params::Bool |
#has_recent_player_notes ⇒ Boolean? (readonly)
Returns whether this player has recent notes.
89 |
# File 'lib/y_fantasy/resources/player.rb', line 89 option :has_recent_player_notes, optional: true, type: Types::Params::Bool |
#headshot ⇒ Hash (readonly)
Returns hash containing headshot information (size, url).
47 |
# File 'lib/y_fantasy/resources/player.rb', line 47 option :headshot |
#image_url ⇒ String (readonly)
Returns the player’s image URL.
51 |
# File 'lib/y_fantasy/resources/player.rb', line 51 option :image_url |
#is_keeper ⇒ Hash (readonly)
Returns A hash containing the player’s keeper status and cost.
55 |
# File 'lib/y_fantasy/resources/player.rb', line 55 option :is_keeper |
#is_undroppable ⇒ Boolean (readonly)
Returns whether this player is undroppable.
59 |
# File 'lib/y_fantasy/resources/player.rb', line 59 option :is_undroppable, type: Types::Params::Bool |
#name ⇒ Hash (readonly)
Returns hash containing the player’s name (first, last, full, ascii_first, ascii_last).
63 |
# File 'lib/y_fantasy/resources/player.rb', line 63 option :name |
#ownership_percentage ⇒ OwnershipPercentage? (readonly)
Returns the ownership percentage information for this player.
124 |
# File 'lib/y_fantasy/resources/player.rb', line 124 option :ownership_percentage, optional: true, type: instance_of(OwnershipPercentage) |
#player_id ⇒ Integer (readonly)
Returns the ID for this player.
14 |
# File 'lib/y_fantasy/resources/player.rb', line 14 option :player_id, type: Types::Coercible::Integer |
#player_key ⇒ String (readonly)
Returns the unique key for this player, within a Game.
10 |
# File 'lib/y_fantasy/resources/player.rb', line 10 option :player_key |
#player_notes_last_timestamp ⇒ Integer? (readonly)
Returns the timestamp of the last player note.
93 |
# File 'lib/y_fantasy/resources/player.rb', line 93 option :player_notes_last_timestamp, optional: true, type: Types::Coercible::Integer |
#player_points ⇒ Hash? (readonly)
Only available when requesting a player within a team’s roster
Hash containing details about the player’s fantasy points. Includes: coverage_type, total, week.
99 100 101 102 103 |
# File 'lib/y_fantasy/resources/player.rb', line 99 option :player_points, optional: true do option :coverage_type option :total, type: Types::Coercible::Float option :week, optional: true, type: Types::Coercible::Integer end |
#position_type ⇒ String (readonly)
Returns the type of position (e.g. “O” for offense).
67 |
# File 'lib/y_fantasy/resources/player.rb', line 67 option :position_type |
#selected_position ⇒ Hash? (readonly)
Only available when requesting a player within a team’s roster
Hash containing details about the player’s selected position. Includes: coverage_type, is_flex, positition, week.
109 110 111 112 113 114 |
# File 'lib/y_fantasy/resources/player.rb', line 109 option :selected_position, optional: true do option :coverage_type option :is_flex, optional: true, type: Types::Params::Bool option :position option :week, optional: true, type: Types::Coercible::Integer end |
#stats ⇒ StatCollection? (readonly)
Returns the stat collection for this player.
128 |
# File 'lib/y_fantasy/resources/player.rb', line 128 option :stats, optional: true, type: instance_of(StatCollection) |
#uniform_number ⇒ String (readonly)
Returns the player’s uniform number.
71 |
# File 'lib/y_fantasy/resources/player.rb', line 71 option :uniform_number |
#url ⇒ String (readonly)
Returns the URL to the player’s Yahoo Fantasy page.
75 |
# File 'lib/y_fantasy/resources/player.rb', line 75 option :url |
Instance Method Details
#first_name ⇒ String
Returns the player’s first name
140 141 142 |
# File 'lib/y_fantasy/resources/player.rb', line 140 def first_name name[:first] end |
#full_name ⇒ String
Returns the player’s full name
152 153 154 |
# File 'lib/y_fantasy/resources/player.rb', line 152 def full_name name[:full] end |
#last_name ⇒ String
Returns the player’s last name
146 147 148 |
# File 'lib/y_fantasy/resources/player.rb', line 146 def last_name name[:last] end |