Method: NewRelic::Agent::AttributePreFiltering.pre_filter_array

Defined in:
lib/new_relic/agent/attribute_pre_filtering.rb

.pre_filter_array(array, options) ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/new_relic/agent/attribute_pre_filtering.rb', line 83

def pre_filter_array(array, options)
  filtered_array = array.each_with_object([]) do |element, filtered|
    filtered_element = pre_filter_object(element, options)
    next if discarded?(filtered_element)

    filtered.push(filtered_element)
  end

  filtered_array.empty? && !array.empty? ? DISCARDED : filtered_array
end