I am a Ruby newbie.
How can I write better for this function? can i use a hash table instead.
def readable_status(status)
if status == "1"
return "go"
end
if status == "2"
return "stop"
end
if status == "3"
return "die"
end
end
If you wanted to use a hash (as per your question) you could do: