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') ⇒ Object



12
13
14
15
# File 'lib/doing/array.rb', line 12

def highlight_tags(color = 'cyan')
  tag_color = Doing::Color.send(color)
  to_tags.map { |t| "#{tag_color}#{t}" }
end

#log_tagsObject



17
18
19
# File 'lib/doing/array.rb', line 17

def log_tags
  highlight_tags.join(', ')
end

#to_tagsObject



8
9
10
# File 'lib/doing/array.rb', line 8

def to_tags
  map { |t| t.sub(/^@?/, '@') }
end