1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.TwitterAPI.Representers.BaseRepresenter do
6 defmacro __using__(_opts) do
12 def to_json(object, options) do
18 def enum_to_list(enum, options) do
19 mapping = fn el -> to_map(el, options) end
20 Enum.map(enum, mapping)
27 def enum_to_json(enum) do
28 enum_to_json(enum, %{})
31 def enum_to_json(enum, options) do
33 |> enum_to_list(options)