Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Modules Ruby Core Modules Enumerable

Enumerable module help!!

I'm not sure where i'm going wrong

player.rb
class Player
  include Comparable
  attr_accessor :name, :score

  def <=>(other)
    score <=> other.score
  end

  def initialize(name, score)
    @name = name
    @score = score
  end
end

class Game
  include Enumerable
  attr_accessor :players

  def each(&block)
    players.each(&block)

  end

  def initialize
    @players = []
  end
end
end
Andrei Burichita
Andrei Burichita
9,989 Points

you have a double END ..just erase the last line and it should work

1 Answer

You should post the error message on the question page. It appears to be that you have to many end's and if this is the case your error should say something like: "unexpected keyword end, expecting end of input". If this was helpful please mark this as best answer