Sha256: e8715cadd8e206da4154b743981bb92b30ab64c16a130a3e0ef37b6c6739dd8a

Contents?: true

Size: 353 Bytes

Versions: 13

Compression:

Stored size: 353 Bytes

Contents

# frozen_string_literal: true

module Doing
  ##
  ## Array helpers
  ##
  class ::Array
    def to_tags
      map { |t| t.sub(/^@?/, '@') }
    end

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

    def log_tags
      highlight_tags.join(', ')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
doing-2.0.25 lib/doing/array.rb
doing-2.0.24 lib/doing/array.rb
doing-2.0.23 lib/doing/array.rb
doing-2.0.22 lib/doing/array.rb
doing-2.0.21 lib/doing/array.rb
doing-2.0.20 lib/doing/array.rb
doing-2.0.19 lib/doing/array.rb
doing-2.0.18 lib/doing/array.rb
doing-2.0.17 lib/doing/array.rb
doing-2.0.16 lib/doing/array.rb
doing-2.0.15 lib/doing/array.rb
doing-2.0.13 lib/doing/array.rb
doing-2.0.11 lib/doing/array.rb