Ruby - La programmation orientée objet I - 19. Hériter d'une fortune




On lesson 19 for Ruby Unit 9: La programmation orientée objet, Partie 1 (french version) an error appear:

Oups, merci de réessayer.
La méthode initialize de Email a-t-elle un unique paramètre : 'sujet' ?

that's mean "The initialize method of e-mail she has a single parameter: 'subject'?"

But the code is right:

class Message
    @@messages_envoyes = 0
    def initialize(de, a)
        @de = de
        @a = a
        @@messages_envoyes += 1

class Email < Message
  def initialize(sujet)
    @sujet = sujet

mon_message ="", "").

Maybe a bug on french version.

I have 99% for Ruby lesson :sob:


I'm fairly confident I can figure out what it wants despite the greek, I want a link to it though!


Here :


Well that's just dumb.

It's looking for a match to /\sujet\b/
and \s is whitespace, so it's looking for space, then ujet and then end of word (\b)

Soo.. give it what it wants.

Add this somewhere:

# ujet

Fixing that bug is just removing the backspace before the s.. wish I had that power


It's work!
I don't understand exactly why must #ujet but ok.

Thanks for your help.


It's just looking for a particular pattern in the code (with no regard to what effect it has on the program, just pure pattern matching on the text) So what that comment does is to just add the text that it looks for in the code file.

It's a bug, it's very sloppy. There's no way to guess what it's supposed to be from just looking at the instructions. Whoever created it clearly didn't test their work.