# DataMapper


A macro module and behaviour with default mapping implementations.

The docs can be found at [](

## Installation

The package can be installed by adding `data_mapper` to your list of dependencies in `mix.exs`:

def deps do
    {:data_mapper, "~> 0.1.0"}

## Usage

defmodule FooMapper do
  @moduledoc """
  Map the Foo external data to our own data structures.
  use DataMapper,
    mappings: %{
      "someFoo" => :foo,
      "someBar" => :bar,
      "extraThing" => :extra_thing

  @impl DataMapper

  def map_field({_, nil} = field), do: field

  def map_field({:bar, field}) do
    {:bar, field * 1000}

  def map_field(field), do: field