Module: Doing::ArrayTags
- Defined in:
- lib/doing/array/tags.rb
Overview
Array helpers
Instance Method Summary collapse
-
#highlight_tags(color = 'cyan') ⇒ Array
Hightlight @tags in string for console output.
-
#log_tags(color = 'cyan') ⇒ String
Tag array for logging.
-
#tags_to_array ⇒ Array
Convert an array of @tags to plain strings.
-
#to_tags ⇒ Array
Convert array of strings to array of @tags.
Instance Method Details
#highlight_tags(color = 'cyan') ⇒ Array
Hightlight @tags in string for console output
37 38 39 |
# File 'lib/doing/array/tags.rb', line 37 def (color = 'cyan') .map { |t| Doing::Color.send(color.to_sym, t) } end |
#log_tags(color = 'cyan') ⇒ String
Tag array for logging
46 47 48 |
# File 'lib/doing/array/tags.rb', line 46 def (color = 'cyan') (color).join(', ') end |
#tags_to_array ⇒ Array
Convert an array of @tags to plain strings
15 16 17 |
# File 'lib/doing/array/tags.rb', line 15 def map(&:remove_at).map(&:strip) end |
#to_tags ⇒ Array
Convert array of strings to array of @tags
25 26 27 |
# File 'lib/doing/array/tags.rb', line 25 def map(&:add_at) end |