public static function parse($data, $format = 'json')
    {
        if (!array_key_exists($format, self::$decoders)) {
            throw new Exception('Invalid decoder.');
        }
        $decoder = self::$decoders[$format];

        $input = file_put_contents('/tmp/input', $data);
        $params = "drafter -f {$format} /tmp/input";

        $results = shell_exec($params);
        return call_user_func([$decoder, 'decode'], $results);
    }