Ruby Ruby Objects and Classes Variables and Methods Variables

I get an error trying to run the last part of this Variables video

class Fede
  def initialize(title, first_name, middle_name, last_name)
    @title = title
    @first_name = first_name
    @middle_name = middle_name
    @last_name = last_name
  def title

  def first_name

  def middle_name 

  def last_name

name ="Mr")
puts name.title + " " +
name.first_name + " " +
name.middle_name + " " +

And this is the Error message I get

name.rb:2:in `initialize': wrong number of arguments (1 for 4)
        from name.rb:25:in `new'                              
        from name.rb:25:in `<main>' 

Please, help

I kinda solved this by thinking about it and doing this, but is this mentioned in the video?

name ="Mr", "Barack", "Hussain", "Obama")

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,432 Points

I answered this here:

There was a cutscene where I'm pretty sure more stuff got changed than we see in the video.

The line near the bottom should say:

name ="Mr", "Jason", "", "Seifer")

thanks, sorry, I thought about it for a while than managed to solve it by myself, I just went through the video a couple of times but couldnt find it :(

Maciej Czuchnowski
Maciej Czuchnowski
36,432 Points

Yeah, Jason doesn't show this part and it just has to be there :). Otherwise the code will never work.