Dayron v0.1.1 Dayron.Requestable protocol

Summary

Functions

Given a json data for a single resource, returns a struct based on value/ module parameter

Given a json data for multiple resources, returns a list of structs based on value/module parameter

Returns the url path representing the value/model and the options

Types

t :: term

Functions

from_json(value, data, opts)

Given a json data for a single resource, returns a struct based on value/ module parameter

from_json_list(value, data, opts)

Given a json data for multiple resources, returns a list of structs based on value/module parameter

url_for(value, opts)

Returns the url path representing the value/model and the options

Example

> Dayron.Requestable.url_for(MyModel, [id: id])
"/mymodels/id"