Module: Doing::ArrayTags

Defined in:
lib/doing/array/tags.rb

Overview

Array helpers

Instance Method Summary collapse

Instance Method Details

#highlight_tags(color = 'cyan') ⇒ Array

Hightlight @tags in string for console output

Parameters:

  • color (String) (defaults to: 'cyan')

    the color to highlight with

Returns:

  • (Array)

    Array of highlighted @tags

#log_tags(color = 'cyan') ⇒ String

Tag array for logging

Returns:

  • (String)

    Highlighted tag array joined with comma

#tags_to_arrayArray

Convert an array of @tags to plain strings

Examples:

Convert an array of tags to strings

['@one', '@two', 'three'].to_tags => ['one', 'two', 'three']

Returns:

  • (Array)

    array of strings without @ symbols

#to_tagsArray

Convert array of strings to array of @tags

Examples:

Convert an array of strings with or without @ symbols

['one', '@two', 'three'].to_tags => ['@one', '@two', '@three']

Returns:

  • (Array)

    Array of @tags