class SleeperRb::Resources::Draft::Pick
A pick from a given draft, containing information about the user and selected player.
Attributes
draft_id[R]
draft_slot[R]
is_keeper[R]
pick_no[R]
picked_by[R]
player_id[R]
roster_id[R]
round[R]
Public Instance Methods
draft()
click to toggle source
Returns the draft instance to which this pick belongs.
@return [SleeperRb::Resources::Draft
]
# File lib/sleeper_rb/resources/draft/pick.rb, line 38
metadata()
click to toggle source
Returns the metadata for this pick.
@return [SleeperRb::resources::Draft::Pick::Metadata]
# File lib/sleeper_rb/resources/draft/pick.rb, line 49 cached_attr :round, :roster_id, :player_id, :picked_by, :pick_no, :is_keeper, :draft_slot, :draft_id, :draft, metadata: ->(hash) { Metadata.new(hash) }
player()
click to toggle source
Returns the player instance selected with this pick.
@return [SleeperRb::Resources::Player
]
# File lib/sleeper_rb/resources/draft/pick.rb, line 61 cached_association :player do Player.new(player_id: player_id) end
roster()
click to toggle source
Returns the roster instance to which this pick belongs.
@return [SleeperRb::Resources::League::Roster
]
# File lib/sleeper_rb/resources/draft/pick.rb, line 70 cached_association :roster do draft.league.rosters.detect { |roster| roster.roster_id == roster_id } end
user()
click to toggle source
Returns the user instance to whom this pick belongs.
@return [SleeperRb::Resources::User
]
# File lib/sleeper_rb/resources/draft/pick.rb, line 79 cached_association :user do draft.league.users.detect { |user| user.user_id == picked_by } end