Form send frame field:
def fio=(fname)
puts fname
end
puts fio - all goods!
change:
def fio=(fname)
return fname
end
puts fio - empty string
Form send frame field:
def fio=(fname)
puts fname
end
puts fio - all goods!
change:
def fio=(fname)
return fname
end
puts fio - empty string
The example code is insufficient to deduce what you do and which result
you hope for.
Can you please give an authentic example-usage of the function?
Your first attempt to puts() the return value of a call to puts() should
print nothing at all, as puts() returns nil and you call fio() without
arguments. What do you call “all goods!"?
Michael U. wrote in post #1162481:
The example code is insufficient to deduce what you do and which result
you hope for.Can you please give an authentic example-usage of the function?
Your first attempt to puts() the return value of a call to puts() should
print nothing at all, as puts() returns nil and you call fio() without
arguments. What do you call “all goods!"?
Ok.
This concern for creating ticket, if user not found - create, foundation
of email, we need add full_name (fname) for created user and added
user_id to ticker tables.
Mike Levchenko wrote in post #1162483:
If you call
puts fio(‘Audo Abu Taji’) or
puts(fio(‘Your Mama’))
the program will print ‘Test’ in each case.
Calls to fio without argument, like in
puts fio
puts(fio() )
Will give you an empty string, as nothing had been stored in an
attribute of name ‘fio’. The argument fname is ignored in your code.
What do you expect and what does not work ?
You should initialize your objects and you do not need a method fio=(),
if you plan to define attribute-accessors anyway!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs