Module: Doing::ItemTags

Included in:
Item
Defined in:
lib/doing/item/tags.rb

Overview

A Doing entry

Instance Method Summary collapse

Instance Method Details

#tag(tags, **options) ⇒ Object

Add (or remove) tags from the title of the item

Parameters:

  • tags (Array)

    The tags to apply

  • options

    Additional options

Options Hash (**options):

  • :date (Boolean)

    Include timestamp?

  • :single (Boolean)

    Log as a single change?

  • :value (String)

    A value to include as @tag(value)

  • :remove (Boolean)

    if true remove instead of adding

  • :rename_to (String)

    if not nil, rename target tag to this tag name

  • :regex (Boolean)

    treat target tag string as regex pattern

  • :force (Boolean)

    with rename_to, add tag if it doesn't exist

#tag_arrayArray

convert tags on item to an array with @ symbols removed

Returns:

  • (Array)

    array of tags

#tagsArray

Get a list of tags on the item

Returns:

  • (Array)

    array of tags (no values)

#tags_with_valuesArray<Array>

Return all tags including parenthetical values

Returns:

  • (Array<Array>)

    Array of array pairs, [[tag1, value], [tag2, value]]