Class: Skylight::Normalizers::Default Private

Inherits:
Normalizer show all
Defined in:
lib/skylight/normalizers/default.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The default normalizer, used if no other is found.

Instance Method Summary collapse

Methods inherited from Normalizer

#normalize_after, #normalize_with_meta, register

Methods included from Util::Logging

#config_for_logging, #debug, #error, #fmt, #info, #log, #log_context, #raise_on_error?, #t, #trace, #trace?, #warn

Constructor Details

#initializeDefault

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Default.



5
6
7
# File 'lib/skylight/normalizers/default.rb', line 5

def initialize
  super(nil) # Pass no config and handle it in new method
end

Instance Method Details

#configObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/skylight/normalizers/default.rb', line 9

def config
  Skylight.config
end

#normalize(_trace, name, payload) ⇒ Array, :skip

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the normalized array or ‘:skip` if `name` is not part of a known tier.

Parameters:

  • trace (Skylight::Messages::Trace::Builder)

    ignored, only present to match API

  • name (String)
  • payload (Hash)

Options Hash (payload):

Returns:

  • (Array, :skip)

    the normalized array or ‘:skip` if `name` is not part of a known tier



19
20
21
# File 'lib/skylight/normalizers/default.rb', line 19

def normalize(_trace, name, payload)
  name =~ Skylight::TIER_REGEX ? [name, payload[:title], payload[:description]] : :skip
end