diff options
Diffstat (limited to 'update.exs')
| -rw-r--r-- | update.exs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/update.exs b/update.exs new file mode 100644 index 0000000..6e42198 --- /dev/null +++ b/update.exs @@ -0,0 +1,21 @@ +defmodule Instance do + defstruct [ + instance_type: nil, + instance_list: [] + ] +end + +defmodule Instances do + def update(filename) do + {:ok, file} = File.read(filename) + {:ok, json} = Poison.decode(file, as: [%Instance{}]) + for x <- json do + IO.puts(x.instance_type) + for y <- x.instance_list do + IO.puts(" - " <> y) + end + end + end +end + +Instances.update("instances.json") |
