module Doing::ArrayTags
Array
helpers
Public Instance Methods
Source
# File lib/doing/array/tags.rb, line 37 def highlight_tags(color = 'cyan') to_tags.map { |t| Doing::Color.send(color.to_sym, t) } end
Hightlight @tags in string for console output
@param color [String] the color to highlight with
@return [Array] Array
of highlighted @tags
Source
# File lib/doing/array/tags.rb, line 46 def log_tags(color = 'cyan') highlight_tags(color).join(', ') end
Tag array for logging
@return [String] Highlighted tag array joined with comma
Source
# File lib/doing/array/tags.rb, line 15 def tags_to_array map(&:remove_at).map(&:strip) end
Convert an array of @tags to plain strings
@return [Array] array of strings without @ symbols
@example Convert an array of tags to strings [‘@one’, ‘@two’, ‘three’].to_tags => [‘one’, ‘two’, ‘three’]
Source
# File lib/doing/array/tags.rb, line 25 def to_tags map(&:add_at) end
Convert array of strings to array of @tags
@return [Array] Array
of @tags
@example Convert an array of strings with or without @ symbols [‘one’, ‘@two’, ‘three’].to_tags => [‘@one’, ‘@two’, ‘@three’]