Sha256: 9a8ee219cac92332a764386e687ae47327bc8ee1db45b278a4022785a576bdc2
Contents?: true
Size: 455 Bytes
Versions: 9
Compression:
Stored size: 455 Bytes
Contents
module FootballManager class Team attr_reader :players def initialize @players = [] end def <<(player) @players << player end def empty? @players.empty? end def size @players.size end def points @players.inject(0) { |total_skill, player| total_skill + player.skill} end def players_ordered_by_name @players.sort_by { |player| player.name } end end end
Version data entries
9 entries across 9 versions & 1 rubygems