Sha256: fe075590da9516b3a28ba38ad4dcb6775201d3cb16b6801c9a44337073c71e72

Contents?: true

Size: 314 Bytes

Versions: 106

Compression:

Stored size: 314 Bytes

Contents

class Roster
  attr_reader :teams

  def initialize
    @teams = []
  end

  def enroll(player)
    team_name = player.team
    team = @teams.find { |team| team.name == team_name }

    unless team
      team = Team.new(team_name)
      @teams << team
    end

    team.enlist(player)
  end
end

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
qwtf_discord_bot-5.5.1 lib/roster.rb
qwtf_discord_bot-5.5.0 lib/roster.rb
qwtf_discord_bot-5.4.13 lib/roster.rb
qwtf_discord_bot-5.4.12 lib/roster.rb
qwtf_discord_bot-5.4.11 lib/roster.rb
qwtf_discord_bot-5.4.10 lib/roster.rb
qwtf_discord_bot-5.4.9 lib/roster.rb
qwtf_discord_bot-5.4.8 lib/roster.rb
qwtf_discord_bot-5.4.7 lib/roster.rb
qwtf_discord_bot-5.4.6 lib/roster.rb
qwtf_discord_bot-5.4.5 lib/roster.rb
qwtf_discord_bot-5.4.4 lib/roster.rb
qwtf_discord_bot-5.4.3 lib/roster.rb
qwtf_discord_bot-5.4.2 lib/roster.rb
qwtf_discord_bot-5.4.1 lib/roster.rb
qwtf_discord_bot-5.4.0 lib/roster.rb
qwtf_discord_bot-5.3.7 lib/roster.rb
qwtf_discord_bot-5.3.6 lib/roster.rb
qwtf_discord_bot-5.3.5 lib/roster.rb
qwtf_discord_bot-5.3.4 lib/roster.rb