I have a method is_numeric? which checks if a string is numeric.
I would like to print out the string to the console as part of a sentence, if the string is numeric I would like to surround it in ' marks.
At present I have something like this…
def i_hate_james_blunt_this_much(how_much)
if how_much.is_numeric?
puts "a hate james blunt this much : '" + string + "'\n"
else
puts "a hate james blunt this much : " + string + "\n"
end
end
but I am sure ruby has some syntactic sugar to make it look sweeter, anyone?
How about: