Sha256: 4a03eaed906a9b95aa90168086aaae1857831a49e278ca0d7b9dbe806f5bd3e3
Contents?: true
Size: 773 Bytes
Versions: 71
Compression:
Stored size: 773 Bytes
Contents
using System.Collections.Generic; using System.IO; using System.Linq; using Newtonsoft.Json; namespace Generators.Input { public static class ConfigFile { private const string ConfigFilePath = "../config.json"; public static IEnumerable<string> GetExerciseNames() { var jsonContents = File.ReadAllText(ConfigFilePath); var config = JsonConvert.DeserializeObject<Config>(jsonContents); return config.Exercises.Select(exercise => exercise.Slug).OrderBy(x => x).ToArray(); } private class Config { public ConfigExercise[] Exercises { get; set; } } private class ConfigExercise { public string Slug { get; set; } } } }
Version data entries
71 entries across 71 versions & 1 rubygems