Taglet v0.2.0 Taglet View Source

Documentation for Taglet.

Link to this section Summary

Functions

Get a persisted struct and inserts a new tag associated to this struct for a specific context

Get a persisted struct and removes the tag association for a specific context

Given a struct, it searchs the associated tags for a specific context

Given a tag, model and context (‘tag’ by default), will find all the model resources associated to the given tag

Link to this section Types

Link to this type persisted_struct() View Source
persisted_struct() :: struct
Link to this type tag_list() View Source
tag_list() :: list

Link to this section Functions

Link to this function add(struct, tags, context \\ "tag") View Source
add(struct, tags, context) :: tag_list

Get a persisted struct and inserts a new tag associated to this struct for a specific context.

You can pass a tag or a list of tags.

In case the tag is duplicated nothing will happen.

It returns a list of associated tags

Link to this function remove(struct, tag, context \\ "tag") View Source
remove(struct, tag, context) :: tag_list

Get a persisted struct and removes the tag association for a specific context.

In case the association doesn’t exist nothing will happen.

It returns a list of associated tags

Link to this function tag_list(struct, context \\ "tag") View Source
tag_list(struct, context) :: tag_list

Given a struct, it searchs the associated tags for a specific context.

It returns a list of associated tags ordered by insert_date

Link to this function tagged_with(tag, model, context \\ "tag") View Source
tagged_with(tag, module, context) :: list

Given a tag, model and context (‘tag’ by default), will find all the model resources associated to the given tag.