/json_parser.ex Secret
Created
January 17, 2017 05:01
Star
You must be signed in to star a gist
This file contains 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 JSONParser do | |
@behaviour Parser | |
def parse(str), do: str # ... parse JSON | |
def extensions, do: ["json"] | |
end |
This file contains 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 Parser do | |
@callback parse(String.t) :: String.t | |
@callback extensions() :: [String.t] | |
end |
This file contains 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 YAMLParser do | |
@behaviour Parser | |
def parse(str), do: [str] # ... parse YAML | |
def extensions, do: ["yml"] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment