Forum: Ruby on Rails I am doing codeschool Ruby Bits Part2, but get stucked.

Ab2c62e8ebcce6cf1a4e7e14be275003?d=identicon&s=25 Naomi Zheng (nzheng)
on 2014-06-25 11:17
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.  :(
I can't solve this problem, please help!!!!!!
1a4ff0766a653c62e0dab34bacda9873?d=identicon&s=25 Norbert Melzer (Guest)
on 2014-06-25 12:59
(Received via mailing list)
If you had used proper intendation you had seen that an end is missing.
Am 25.06.2014 11:17 schrieb "Naomi Zheng" <lists@ruby-forum.com>:
9f6cc53a187d33e92952eaf0863d93e1?d=identicon&s=25 Monika M (Guest)
on 2014-06-25 13:24
(Received via mailing list)
Hi Naomi

You have missed one 'end'. Put 'end' at the end of the file.
Ab2c62e8ebcce6cf1a4e7e14be275003?d=identicon&s=25 Naomi Zheng (nzheng)
on 2014-06-25 15:27
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. :)
Ab2c62e8ebcce6cf1a4e7e14be275003?d=identicon&s=25 Naomi Zheng (nzheng)
on 2014-06-25 15:27
Norbert Melzer wrote in post #1150694:
> If you had used proper intendation you had seen that an end is missing.
> Am 25.06.2014 11:17 schrieb "Naomi Zheng" <lists@ruby-forum.com>:

Thank you. :)
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.