Current section
Files
Jump to
Current section
Files
lib/crawlberg/cookie_info.ex
# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:75130b11765cbed0a1ea2b5bcffe59620c4045cee1c7cece391c5e3fa47b10e0
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Crawlberg.CookieInfo do
@moduledoc "Information about an HTTP cookie received from a response."
@typedoc "Information about an HTTP cookie received from a response."
@type t :: %__MODULE__{
name: String.t() | nil,
value: String.t() | nil,
domain: String.t() | nil,
path: String.t() | nil
}
defstruct name: nil,
value: nil,
domain: nil,
path: nil
defimpl Jason.Encoder do
@doc false
def encode(value, opts) do
value
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> v == nil end)
|> Enum.into(%{})
|> Jason.Encoder.encode(opts)
end
end
end