class SleeperRb::Resources::League::Matchup

Represents a matchup for a specific team in a specific week. Two records with the same matchup_id are paired against each other.

Attributes

custom_points[R]
matchup_id[R]
points[R]
roster_id[R]
starters_points[R]

Public Instance Methods

league() click to toggle source

@return [SleeperRb::Resources::League]

# File lib/sleeper_rb/resources/league/matchup.rb, line 28
        
players() click to toggle source

All players on the roster for this matchup.

@return [SleeperRb::Resources::Player]

# File lib/sleeper_rb/resources/league/matchup.rb, line 44
cached_attr :starters_points, :roster_id, :points, :matchup_id, :custom_points, :league,
            starters: ->(array) { array&.map { |id| Player.new(player_id: id) } },
            players: ->(array) { array&.map { |id| Player.new(player_id: id) } }
roster() click to toggle source

@return [SleeperRb::Resources::League::Roster]

# File lib/sleeper_rb/resources/league/matchup.rb, line 54
cached_association :roster do
  retrieve_roster!
end
starters() click to toggle source

All players starting on the roster for this matchup.

@return [SleeperRb::Resources::Player]

# File lib/sleeper_rb/resources/league/matchup.rb, line 33
        

Private Instance Methods

retrieve_roster!() click to toggle source
# File lib/sleeper_rb/resources/league/matchup.rb, line 60
def retrieve_roster!
  league.rosters.detect { |roster| roster.roster_id == roster_id }
end