Class: YFantasy::League::Standings
- Inherits:
-
BaseSubresource
- Object
- BaseSubresource
- YFantasy::League::Standings
- Defined in:
- lib/y_fantasy/resources/league/standings.rb
Overview
Standings for a league
Instance Method Summary collapse
-
#final ⇒ Array<Hash>
Returns an array of team hashes, sorted by rank.
-
#regular_season ⇒ Array<Hash>
Returns an array of team hashes, sorted by wins and points for.
Methods inherited from BaseSubresource
dependent?, find, resource_name
Methods included from Subresourceable
Instance Method Details
#final ⇒ Array<Hash>
Returns an array of team hashes, sorted by rank.
14 15 16 |
# File 'lib/y_fantasy/resources/league/standings.rb', line 14 def final teams.map(&:simple_standings).sort_by { |h| h[:rank] } end |
#regular_season ⇒ Array<Hash>
Returns an array of team hashes, sorted by wins and points for.
20 21 22 |
# File 'lib/y_fantasy/resources/league/standings.rb', line 20 def regular_season teams.map(&:simple_standings).sort_by { |h| [-h[:wins], -h[:points_for]] } end |