Inside the method "set_name"  "first_name" will be set to point to the
String "Jack" (in your example).

Then you are calling...

set_first_name(first_name)

Inside the set_first_name method, the name of the parameter is "name".
So this reference to "Jack" is passed as the "name" parameter.

Now,
"first_name" inside the set_name method and
"name" inside the set_first_name method are
both pointing to the same object, the String "Jack".

I think your point is valid because the parameter name could be
"first_name" to rhyme with the method name "set_first_name".
But, no matter what you call it at all.

It could be something like

===
class Person
  def initialize(name)
    set_name(name)
  end

  def name
    @first_name + ' ' + @last_name
  end

  def set_name(name)
    first_name, last_name = name.split(/\s+/)
    set_first_name(first_name)
    set_last_name(last_name)
  end

  def set_first_name(first_name)
    @first_name = first_name
  end

  def set_last_name(last_name)
    @last_name = last_name
  end
end
===

But, I think "name" is shorter!

Abinoam Jr.

On Fri, Jan 10, 2014 at 9:56 PM, Taz798 U. <lists / ruby-forum.com> wrote:
> Thanks.
>
> The (name) put me off, but I get it now :)
>
> --
> Posted via http://www.ruby-forum.com/.