Class: Cogger::Formatters::Parsers::Emoji

Inherits:
Abstract
  • Object
show all
Defined in:
lib/cogger/formatters/parsers/emoji.rb

Overview

Parses template emojis for specific and dynamic colors.

Constant Summary collapse

PATTERN =
/
  %<                 # Start.
  (?<key>emoji)      # Key.
  :                  # Delimiter.
  (?<directive>\w+)  # Directive.
  >s                 # End.
/x

Constants inherited from Abstract

Abstract::NEW_LINE, Abstract::SANITIZERS

Instance Method Summary collapse

Constructor Details

#initialize(pattern: PATTERN) ⇒ Emoji

Returns a new instance of Emoji.



16
17
18
19
# File 'lib/cogger/formatters/parsers/emoji.rb', line 16

def initialize pattern: PATTERN
  super()
  @pattern = pattern
end

Instance Method Details

#call(template, level) ⇒ Object



21
22
23
24
# File 'lib/cogger/formatters/parsers/emoji.rb', line 21

def call template, level
  mutate template, level
  template
end