Class: Skylight::Core::Normalizers::Graphiti::Resolve Private

Inherits:
Normalizer
  • Object
show all
Defined in:
lib/skylight/core/normalizers/graphiti/resolve.rb

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.

Constant Summary collapse

CAT =

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

"app.resolve.graphiti"
ANONYMOUS_RESOURCE =

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

"<Anonymous Resource>"
ANONYMOUS_ADAPTER =

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

"<Anonymous Adapter>"

Instance Attribute Summary

Attributes inherited from Normalizer

#config

Instance Method Summary collapse

Methods inherited from Normalizer

#initialize, #normalize_after, register

Constructor Details

This class inherits a constructor from Skylight::Core::Normalizers::Normalizer

Instance Method Details

#normalize(_trace, _name, payload) ⇒ Object

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.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/skylight/core/normalizers/graphiti/resolve.rb', line 14

def normalize(_trace, _name, payload)
  resource = payload[:resource]

  if (sideload = payload[:sideload])
    type = sideload.type.to_s.split("_").map(&:capitalize).join(" ")
    desc = "Custom Scope" if sideload.class.scope_proc
  else
    type = "Primary"
  end

  title = "Resolve #{type} #{resource.class.name || ANONYMOUS_RESOURCE}"

  [CAT, title, desc]
end