defmodule JOL.Blog.Post do @enforce_keys [:title, :body, :draft, :date, :tags] defstruct [:title, :body, :draft, :date, :tags] def build(_filename, attrs, body) do struct!(__MODULE__, [body: body] ++ Map.to_list(attrs)) end end