Class: StackifyRubyAPM::Normalizers::Collection Private

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify_apm/normalizers.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.

Defined Under Namespace

Classes: SkipNormalizer

Instance Method Summary collapse

Constructor Details

#initialize(normalizers) ⇒ Collection

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 Collection.



44
45
46
47
# File 'lib/stackify_apm/normalizers.rb', line 44

def initialize(normalizers)
  @normalizers = normalizers
  @default = SkipNormalizer.new
end

Instance Method Details

#for(name) ⇒ 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.



49
50
51
52
53
54
# File 'lib/stackify_apm/normalizers.rb', line 49

def for(name)
  # Performance suggestion by fasterer
  # Hash#fetch with second argument is slower than Hash#fetch with block.
  # @normalizers.fetch(name, @default)
  @normalizers.fetch(name) { @default }
end

#keysObject

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.



56
57
58
# File 'lib/stackify_apm/normalizers.rb', line 56

def keys
  @normalizers.keys
end

#normalize(transaction, 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.



60
61
62
# File 'lib/stackify_apm/normalizers.rb', line 60

def normalize(transaction, name, payload)
  self.for(name).normalize(transaction, name, payload)
end