Skip to content

Instantly share code, notes, and snippets.

@storm255
storm255 / default_behaviour.ex
Created November 17, 2022 08:49 — forked from christhekeele/default_behaviour.ex
Behaviours with Defaults for Elixir
defmodule Default.Behaviour do
@moduledoc """
Creates a behaviour that carries its own default implementation.
When used into a behaviour module, when that module in turn is used, all functions
defined on it are given to the using module.
This allows you to have concrete implementations of the behaviour's default functionality
for testing, unlike cramming them all into a __using__ macro.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 29.03.2012
@author: pn
'''
import sys
import traceback
import argparse