Class: Cogger::Formatters::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/cogger/formatters/abstract.rb

Overview

An abstract class with common/shared functionality.

Constant Summary collapse

NEW_LINE =
"\n"
SANITIZERS =
{
  escape: Sanitizers::Escape.new,
  filter: Sanitizers::Filter,
  format_time: Sanitizers::FormatTime
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(sanitizers: SANITIZERS) ⇒ Abstract

Returns a new instance of Abstract.



15
16
17
# File 'lib/cogger/formatters/abstract.rb', line 15

def initialize sanitizers: SANITIZERS
  @sanitizers = sanitizers
end

Instance Method Details

#callObject



19
20
21
22
# File 'lib/cogger/formatters/abstract.rb', line 19

def call(*)
  fail NoMethodError,
       "`#{self.class}##{__method__} #{method(__method__).parameters}` must be implemented."
end