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

bug-composer
french
ruby
sct

#1


Hello,

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
    end
end

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

mon_message = Message.new("truc@co.com", "machiin@co.com").


Maybe a bug on french version.

I have 99% for Ruby lesson :sob:


#2

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


#3

Here :

https://www.codecademy.com/fr/courses/ruby-beginner-fr-FR-ijkr8/3/4?curriculum_id=535e93005d81962043000001#


#4

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


#5

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

Thanks for your help.


#6

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.