2024-07-30 15:46:47 +00:00
|
|
|
defmodule JOL.Blog.Post do
|
2024-07-30 15:49:01 +00:00
|
|
|
@enforce_keys [:author, :draft, :title, :body, :tags, :date]
|
|
|
|
defstruct [:author, :draft, :title, :body, :tags, :date]
|
2024-07-30 15:46:47 +00:00
|
|
|
|
|
|
|
def build(_filename, attrs, body) do
|
2024-07-30 15:49:01 +00:00
|
|
|
struct!(__MODULE__, [author: "Jessica Phoenix Canady", body: body] ++ Map.to_list(attrs))
|
2024-07-30 15:46:47 +00:00
|
|
|
end
|
|
|
|
end
|