+ 2

I'm stock in "undefined local variable or method 'fullname' for main:Object (NameError)

myArray = ["Safianu Mohammed", "mohammedsafianu"] def cutName(first_name, last_name) name = first_name + last_name end name = myArray [0..0] print name my_info = { "fullname" => "Safianu Mohammed", "skype" => "mohammedsafianu", "github" => "null" } puts fullname puts skype puts github

14th Apr 2017, 10:04 AM
Safianu Mohammed
Safianu Mohammed - avatar
4 Antworten
+ 5
I don't know that language but it looks like it need to enter my_info to be able to get fullname value. With javascript it would be my_info.fullname.
14th Apr 2017, 10:15 AM
Geoffrey L
Geoffrey L - avatar
+ 3
Thanks for the answer :3
14th Apr 2017, 10:18 AM
Geoffrey L
Geoffrey L - avatar
+ 2
This is ruby codes
14th Apr 2017, 10:17 AM
Safianu Mohammed
Safianu Mohammed - avatar
+ 2
thanks to you all for the suggestions but I figured it out that I have call it inside a [braces] and will "double quote" e.g. puts ["fullname"] puts ["skype"] puts ["github"]
16th Apr 2017, 1:53 PM
Safianu Mohammed
Safianu Mohammed - avatar