Class: Skylight::Normalizers::Grape::EndpointRender Private

Inherits:
Endpoint show all
Defined in:
lib/skylight/normalizers/grape/endpoint_render.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.grape.endpoint".freeze

Instance Attribute Summary

Attributes inherited from Normalizer

#config

Instance Method Summary collapse

Methods inherited from Normalizer

#initialize, #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

This class inherits a constructor from Skylight::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.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/skylight/normalizers/grape/endpoint_render.rb', line 9

def normalize(_trace, _name, payload)
  if (endpoint = payload[:endpoint])
    path = get_path(endpoint)
    namespace = get_namespace(endpoint)
    method = get_method(endpoint)

    title = [method, namespace, path].join(" ").gsub(/\s+/, " ")

    [CAT, title, nil]
  else
    :skip
  end
end