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 Web.CardParams do | |
| defstruct holder_name: "name", | |
| last_digits: "1234", | |
| address: %Web.AddressParams{street: "rua dos bobos", number: "zero"} | |
| @enforce_keys [:holder_name, :last_digits, :address] | |
| # esse cara aqui pra mim é problemático | |
| # Ou você continua dependendo do Core.Address | |
| # ou você tem que tirar o nome da struct e passar um map |
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 MakeBehaviour do | |
| defmacro __using__(opts) do | |
| module = opts[:module] | |
| quote do | |
| if not is_nil(unquote(module)) do | |
| import unquote(module) | |
| end | |
| @on_definition {MakeBehaviour, :on_def} | |
| end | |
| end |
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 X do | |
| @moduledoc """ | |
| iex> X.a | |
| "happy_emoji" | |
| """ | |
| Enum.each( | |
| [:"😀"], | |
| fn (name) -> | |
| def unquote(name)(), do: "happy_emoji" |
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
| TEST_COUNT ?= 4 | |
| test: | |
| ifeq ($(TEST_COUNT), 2) | |
| exit 0; | |
| else | |
| exit 1; | |
| endif | |
| retry-test: |
NewerOlder