Google

def Parser.parse( input ) case input when String parse_helper input when File parse_helper input.read end end