Class: Cogger::Formatters::Parsers::Key
- Defined in:
- lib/cogger/formatters/parsers/key.rb
Overview
Parses template for specific and dynamic keys (i.e. string format specifiers).
Constant Summary collapse
- PATTERN =
/ % # Start. (?<flag>[\s#+-0*])? # Optional flag. \.? # Optional precision. (?<width>\d+)? # Optional width. < # Reference start. (?<key>\w+) # Key. : # Delimiter. (?<directive>\w+) # Directive. > # Reference end. (?<specifier>[ABEGXabcdefgiopsux]) # Specifier. /x
Constants inherited from Abstract
Abstract::NEW_LINE, Abstract::SANITIZERS
Instance Method Summary collapse
- #call(template, level) ⇒ Object
-
#initialize(pattern: PATTERN) ⇒ Key
constructor
A new instance of Key.
Constructor Details
Instance Method Details
#call(template, level) ⇒ Object
28 29 30 31 |
# File 'lib/cogger/formatters/parsers/key.rb', line 28 def call template, level mutate template, level template end |