CPF v1.1.0 CPF.Ecto.Type View Source

Provide you functions to use the CPF type in your Ecto schema fields.

Usage

defmodule MyApp.MySchema do
  use Ecto.Schema
  # Import the cpf_type/1 helper
  import CPF.Ecto.Type

  schema "my_schemas" do
    # use the helpers functions in any field
    field :cpf, cpf_type(:string)
  end
end

Link to this section Summary

Functions

A parameterized type macro function.

Link to this section Functions

Link to this macro

cpf_type(atom)

View Source (macro)
cpf_type(:bigint | :string) :: Macro.t()

A parameterized type macro function.

  • cpf_type(:bigint) is a alias for CPF.Ecto.Type.Bigint
  • cpf_type(:string) is a alias for CPF.Ecto.Type.String