It's probably easier if you're used to think in pointers / references.
Ignore for the moment that fixnums are special (immediate values).

> def do_something(a, b, c)
>     a = a + 1
>     b = b + 2
>     c = c + 3
> end

do_something receives 3 references in the declaration. those references
are places in three method-local variables.
in the body, it changes the local-variables to references that point to
*other* objects.



> a, b, c = 5, 6, 7

you have created three local variables, referencing fixnum objects.

> puts "before do_something:"
> puts "a : #{a}"
> puts "b : #{b}"
> puts "c : #{c}"

you print the values of the objects referenced by the local variables.

> do_something(a, b, c)

you called do_something, which received the references, and changed *in
the method body only* the method-local variables to point to other
objects.

> puts "after do_something:"
> puts "a : #{a}"
> puts "b : #{b}"
> puts "c : #{c}"

here you print the values referenced by the outside-scope local
variables. these local-variables have never been changed in this scope
so they point to the same fixnum objects you specified in the
beginning.


> My issue:
> I would like to see the value of a, b, c after calling #do_something
as:
> a = 6, b = 8, c = 10
>
> how can I do it without making a, b, c an instance variable?
> In other words, how can I send value by reference?

you have some options:
- global variables ($var): ugly and not recommended.
- return the new values: probably cleanest way.

def do_something(a, b, c)
a = a + 1
b = b + 2
c = c + 3
[a, b, c]
end
a, b, c = 5, 6, 7
a, b, c = do_something(a, b, c)

- create a box class: essentially a pointer. both the ouside-scope and
the method-scope local-variables point to the same box object so you
can change fields in the box object and those changes will be reflected
in all scopes.

HTH,
Assaph