Created
February 3, 2017 21:47
-
-
Save shdblowers/bc82c74946bdac07fff6879bb86ae93d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GherkinTests.State do | |
def store(state, key, value), do: Map.put(state, key, value) | |
def retrieve(state, key), do: Map.get(state, key) | |
def set_if_not_exists(state, key, value) do | |
if Map.has_key?(state, key) do | |
state | |
else | |
store(state, key, value) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment