Skip to content

Commit

Permalink
Remove default adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedijkstra committed Nov 24, 2017
1 parent 8fa7eaa commit 62986f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/ex_cell/adapter.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
defmodule ExCell.Adapter do
@moduledoc false
@callback container(Map.t) :: {:safe, List.t}
end
2 changes: 2 additions & 0 deletions lib/ex_cell/adapters/cell_js.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule ExCell.Adapters.CellJS do
@moduledoc false

@behaviour ExCell.Adapter

alias Phoenix.HTML.Tag
Expand Down
4 changes: 3 additions & 1 deletion lib/ex_cell/base.ex
Original file line number Diff line number Diff line change
@@ -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 """
Expand Down
4 changes: 2 additions & 2 deletions lib/ex_cell/ex_cell.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit 62986f5

Please sign in to comment.