2024-06-04 16:13:06 +00:00
|
|
|
defmodule JOL.Blog.Post do
|
2024-06-04 18:09:14 +00:00
|
|
|
@enforce_keys [:author, :title, :body, :tags, :date, :slug]
|
|
|
|
defstruct [:author, :draft, :title, :body, :tags, :date, :slug]
|
2024-06-04 16:13:06 +00:00
|
|
|
|
|
|
|
def build(_filename, attrs, body) do
|
|
|
|
struct!(__MODULE__, [author: "Jessica Phoenix Canady", body: body] ++ Map.to_list(attrs))
|
|
|
|
end
|
|
|
|
end
|