Class: Skylight::Core::Normalizers::Default Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/core/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

Instance Method Details

#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):

  • :title (String)
  • :description (String)

Returns:

  • (Array, :skip)

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



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/skylight/core/normalizers/default.rb', line 11

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