Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/slacktail/extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#to_colsole_colorObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/slacktail/extensions/string.rb', line 6

def to_colsole_color
  color = {
    '000000' => :wht,
    'ff0000' => :red,
    '00ff00' => :grn,
    '0000ff' => :blu,
    'ffff00' => :ylw,
    'ff00ff' => :pur,
    '00ffff' => :cyn,
    'ffffff' => :blk,
  }

  key = self.downcase
  color.keys.include?(key) ? color[key] : :rst
end

#to_markdownObject



2
3
4
# File 'lib/slacktail/extensions/string.rb', line 2

def to_markdown
  TTY::Markdown.parse self
end