Skip to content

Commit

Permalink
selection: implement for nil as well
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Jul 4, 2014
1 parent e94993a commit 367e6c5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/amnesia/selection.ex
Expand Up @@ -3,3 +3,17 @@ defprotocol Amnesia.Selection do
def next(self)
def values(self)
end

defimpl Amnesia.Selection, for: Atom do
def coerce(nil, _) do
nil
end

def next(nil) do
nil
end

def values(nil) do
[]
end
end

0 comments on commit 367e6c5

Please sign in to comment.