Class: Cogger::Formatters::Abstract
- Inherits:
-
Object
- Object
- Cogger::Formatters::Abstract
- Defined in:
- lib/cogger/formatters/abstract.rb
Overview
An abstract class with common/shared functionality.
Direct Known Subclasses
Color, Crash, JSON, Parsers::Element, Parsers::Emoji, Parsers::Key, Property, Simple
Constant Summary collapse
- NEW_LINE =
"\n"
- SANITIZERS =
{ escape: Sanitizers::Escape.new, filter: Sanitizers::Filter, format_time: Sanitizers::FormatTime }.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(sanitizers: SANITIZERS) ⇒ Abstract
constructor
A new instance of Abstract.
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
#call ⇒ Object
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 |