Pivo v0.1.0 Pivo.Resource behaviour View Source

Resource behaviour module.

Defines the behaviour and a generic implementation of the callbacks for a given resource.

This module is meant to be use'd in custom modules in order to support different resources of the Pivotal's Tracker API.

Example

defmodule Pivo.Resources.TimeZone do
  @enforce_keys [:olson_name, :offset, :kind]
  use Pivo.Resource
  defstruct @enforce_keys
end

Link to this section Summary

Callbacks

Builds the current resource struct from a map.

Builds a list of ids of the current resource from a list of maps.

Builds a list of ids of the current resource from a list of maps and an accessor function.

Builds a list of the current resource from a list of maps.

Link to this section Types

Link to this section Callbacks

Link to this callback

build(arg)

View Source
build(arg :: map()) :: struct()

Builds the current resource struct from a map.

Link to this callback

build_ids_list(args)

View Source
build_ids_list(args :: list()) :: [integer()]

Builds a list of ids of the current resource from a list of maps.

Link to this callback

build_ids_list(args, accessor)

View Source
build_ids_list(args :: list(), accessor :: (... -> any())) :: [integer()]

Builds a list of ids of the current resource from a list of maps and an accessor function.

Link to this callback

build_items_list(args)

View Source
build_items_list(args :: list()) :: [struct()]

Builds a list of the current resource from a list of maps.