From 62986f5475aa6e4885aec7095e9b22a6d7bcbd6c Mon Sep 17 00:00:00 2001 From: Jesse Dijkstra Date: Fri, 24 Nov 2017 15:25:52 +0100 Subject: [PATCH] Remove default adapter --- lib/ex_cell/adapter.ex | 1 + lib/ex_cell/adapters/cell_js.ex | 2 ++ lib/ex_cell/base.ex | 4 +++- lib/ex_cell/ex_cell.ex | 4 ++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/ex_cell/adapter.ex b/lib/ex_cell/adapter.ex index 63df4b7..40b24b2 100644 --- a/lib/ex_cell/adapter.ex +++ b/lib/ex_cell/adapter.ex @@ -1,3 +1,4 @@ defmodule ExCell.Adapter do + @moduledoc false @callback container(Map.t) :: {:safe, List.t} end diff --git a/lib/ex_cell/adapters/cell_js.ex b/lib/ex_cell/adapters/cell_js.ex index 743953f..b034d44 100644 --- a/lib/ex_cell/adapters/cell_js.ex +++ b/lib/ex_cell/adapters/cell_js.ex @@ -1,4 +1,6 @@ defmodule ExCell.Adapters.CellJS do + @moduledoc false + @behaviour ExCell.Adapter alias Phoenix.HTML.Tag diff --git a/lib/ex_cell/base.ex b/lib/ex_cell/base.ex index 3ba0dfc..caf832a 100644 --- a/lib/ex_cell/base.ex +++ b/lib/ex_cell/base.ex @@ -1,9 +1,11 @@ defmodule ExCell.Base do + @moduledoc false + defmacro __using__(opts \\ []) do quote do import ExCell.View - @adapter unquote(opts[:adapter] || ExCell.Adapters.CellJS) + @adapter unquote(opts[:adapter]) @namespace unquote(opts[:namespace]) @doc """ diff --git a/lib/ex_cell/ex_cell.ex b/lib/ex_cell/ex_cell.ex index b8036ce..b94a960 100644 --- a/lib/ex_cell/ex_cell.ex +++ b/lib/ex_cell/ex_cell.ex @@ -14,7 +14,6 @@ defmodule ExCell do |> Keyword.get(keyword, fallback) end - def relative_name(module, namespace) do parts = case namespace do nil -> Module.split(module) @@ -32,7 +31,8 @@ defmodule ExCell do end def container(module, params, attributes, [do: content]) do - options(module, params, attributes, content) + module + |> options(params, attributes, content) |> module.__adapter__().container() end