Phoenix Webframework is the Rails like framework in the Elixir ecosystem.
Publishing a package to elixir
Ternary Operator
While elixir does not have a ternary operator, one can be achieved with:
Behaviours
Behaviours are similar to interface in Object Oriented Programming. The behaviour module defines the generic interface, and the callback module implements that interface.
And then an implementation would look like:
Re-arranging Parameters in a call then
When dealing with a chain, and the result of the previous call needs to
be pass into a position other than the first spot, use then
or more succinctly using short hand:
Regex
Debugging elixirhacks
dbg
is incredibly helpful for debugging a chain of method calls:
This is the equivalent of