What is the meaning of ? in ruby

I’m not sure it’s good practise to end a normal method with a question mark in Ruby. This is because in Ruby, there is a naming convention where predicate methods (those that return true or false) end with a question mark. For instance, if you have an Invoice class and are writing an instance method that returns whether the invoice has been paid or not, you would name the method paid?

I would probably call the method you describe something like get_user_name

You can read more here: http://pragmati.st/2012/03/24/the-elements-of-ruby-style-predicate-methods/