Exop v0.2.2 Exop.Operation behaviour

Provides macros for an operation’s contract definition and process/1 function.

Example

defmodule SomeOperation do
  use Exop.Operation

  parameter :param1, type: :integer, required: true
  parameter :param2, type: :string, length: %{max: 3}, format: ~r/foo/

  def process(params) do
    "This is the operation's result with one of the params = " <> params[:param1]
  end
end

Summary

Macros

parameter(name, opts \\ [])

Specs

parameter(term, atom, Keyword.t) :: none

Callbacks

process(arg0)

Specs

process(Keyword.t | Map.t) :: any