2025-01-01 15:49:27 +01:00
|
|
|
namespace AIStudio.Assistants.ERI;
|
|
|
|
|
|
|
|
|
|
public static class ERIVersionExtensions
|
|
|
|
|
{
|
2026-11-01 12:29:37 +01:00
|
|
|
public static Task<string> ReadSpecification(this ERIVersion version, WebRootFiles webRootFiles) => webRootFiles.ReadTextAsync(version.SpecificationURL());
|
|
|
|
|
|
2025-01-01 15:49:27 +01:00
|
|
|
public static string SpecificationURL(this ERIVersion version)
|
|
|
|
|
{
|
|
|
|
|
var nameLower = version.ToString().ToLowerInvariant();
|
|
|
|
|
var filename = $"{nameLower}.json";
|
|
|
|
|
return $"specs/eri/{filename}";
|
|
|
|
|
}
|
2026-11-01 12:29:37 +01:00
|
|
|
|
2025-01-01 15:49:27 +01:00
|
|
|
public static bool WasSpecificationSelected(this ERIVersion version) => version != ERIVersion.NONE;
|
|
|
|
|
}
|