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