summaryrefslogtreecommitdiff
path: root/lib/powerdnsex/models/record.ex
blob: 82dca744a43c1da5ff25cb9fb6facf09c1601584 (plain) (blame)
1
2
3
4
5
6
7
8
9
defmodule PowerDNSex.Models.Record do
  defstruct [:content, :disabled]

  def as_body(content) when is_list(content) do
    Enum.reduce(content, [], fn({value, status}, records) ->
      records ++ [%__MODULE__{ content: value, disabled: status }]
    end)
  end
end