class SleeperRb::Resources::League::Roster::Settings

Settings for a specific roster in a league, including W/L/D, scoring_data, and waiver info.

Attributes

fpts[R]
fpts_against[R]
fpts_against_decimal[R]
fpts_decimal[R]
losses[R]
ties[R]
total_moves[R]
waiver_budget_used[R]
waiver_position[R]
wins[R]

Public Instance Methods

record_string() click to toggle source

@return [String] Record for the roster in W - L - T format

# File lib/sleeper_rb/resources/league/roster/settings.rb, line 69
def record_string
  "#{wins} - #{losses} - #{ties}"
end
total_points() click to toggle source

@return [Float] All points scored by the roster

# File lib/sleeper_rb/resources/league/roster/settings.rb, line 49
def total_points
  (fpts.to_f + (fpts_decimal.to_f * 0.01)).round(2)
end
total_points_against() click to toggle source

@return [Float] All points scored against the roster

# File lib/sleeper_rb/resources/league/roster/settings.rb, line 55
def total_points_against
  (fpts_against.to_f + (fpts_against_decimal.to_f * 0.01)).round(2)
end
win_pct() click to toggle source

@return [Float] Percentage of games won by the roster

# File lib/sleeper_rb/resources/league/roster/settings.rb, line 61
def win_pct
  return 0.0 unless [wins, ties, losses].any?(&:positive?)

  ((wins.to_f / (wins + ties + losses)) * 100.0).round(2)
end