I am doing codeschool Ruby Bits Part2, but get stucked.

In this lesson, I am learning optional block.
class Library
  attr_accessor :games

  def initialize(games)
    @games = games
  end

  def list
    games.each do |game|
      if block_given?
      puts yield game
    else
      puts game.name

    end
  end
end

When I summit code, it shows syntax error, unexpected end_of_file. :frowning:
I can't solve this problem, please help!!!!!!

Hi Naomi

You have missed one ‘end’. Put ‘end’ at the end of the file.

If you had used proper intendation you had seen that an end is missing.

Monika M wrote in post #1150695:

Hi Naomi

You have missed one 'end'. Put 'end' at the end of the file.

Thank you so much. :slight_smile:

Norbert Melzer wrote in post #1150694:

If you had used proper intendation you had seen that an end is missing.

Thank you. :slight_smile: