Class: YFantasy::DraftResult

Inherits:
BaseSubresource show all
Defined in:
lib/y_fantasy/resources/shared_subresources/draft_result.rb

Overview

Represents a single draft result in a Yahoo Fantasy league

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseSubresource

dependent?, find, resource_name

Methods included from Subresourceable

included

Instance Attribute Details

#pickInteger (readonly)

Returns the pick number.

Returns:

  • (Integer)

    the pick number



10
# File 'lib/y_fantasy/resources/shared_subresources/draft_result.rb', line 10

option :pick, type: Types::Coercible::Integer

#player_keyString (readonly)

Returns the unique key for the player drafted.

Returns:

  • (String)

    the unique key for the player drafted



18
# File 'lib/y_fantasy/resources/shared_subresources/draft_result.rb', line 18

option :player_key

#roundInteger (readonly)

Returns the draft round.

Returns:

  • (Integer)

    the draft round



14
# File 'lib/y_fantasy/resources/shared_subresources/draft_result.rb', line 14

option :round, type: Types::Coercible::Integer

#team_keyString (readonly)

Returns the unique key for the drafting team.

Returns:

  • (String)

    the unique key for the drafting team



22
# File 'lib/y_fantasy/resources/shared_subresources/draft_result.rb', line 22

option :team_key

Instance Method Details

#playerPlayer

Retrieves the Player resource associated with this draft result

Returns:

  • (Player)

    the player drafted



28
29
30
# File 'lib/y_fantasy/resources/shared_subresources/draft_result.rb', line 28

def player
  self.class.find(:player, player_key)
end

#teamTeam

Retrieves the Team resource associated with this draft result

Returns:

  • (Team)

    the drafting team



34
35
36
# File 'lib/y_fantasy/resources/shared_subresources/draft_result.rb', line 34

def team
  self.class.find(:team, team_key)
end