Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/doing/array.rb

Overview

Array helpers

Direct Known Subclasses

Doing::Items, Doing::Note

Instance Method Summary collapse

Instance Method Details

#highlight_tags(color = 'cyan') ⇒ String

Hightlight @tags in string for console output

Parameters:

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

    the color to highlight with

Returns:

  • (String)

    string with @tags highlighted

#log_tagsString

Tag array for logging

Returns:

  • (String)

    Highlighted tag array joined with comma

#nested_hash(value) ⇒ Object

Convert array to nested hash, setting last key to value

Parameters:

  • value

    The value to set

Raises:

  • (StandardError)

#to_tagsArray

Convert strings to @tags

Examples:

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

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

Returns:

  • (Array)

    Array of @tags

#to_tags!Object