# File lib/uuid.rb, line 454
454:     def generate(format = :default)
455:       @socket.write "\0"
456:       uuid = @socket.read(36)
457:       return uuid if format == :default
458:       template = FORMATS[format]
459:       raise ArgumentError, "invalid UUID format #{format.inspect}" unless template
460:       template % uuid.split("-").map { |p| p.to_i(16) }
461:     end