JOL/lib/jol/blog/post.ex

9 lines
299 B
Elixir

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