I need a function which returns/prints the sign on an integer. So far I came up with this:
def extract_sign(integer) integer >= 0 ? \'+\' : \'-\' end >
Ruby doesn't have a built in sign function like Javascript. Here's a thread that explains more http://www.ruby-forum.com/topic/141216
Your approach looks correct.