Sha256: e0f861c96a5e6f480efb24d5595e4a72a4ee9544e3cb89848a93a32ad801482c

Contents?: true

Size: 566 Bytes

Versions: 27

Compression:

Stored size: 566 Bytes

Contents

module Raven
  class Processor::RemoveCircularReferences < Processor
    def process(value, visited = [])
      return "(...)" if visited.include?(value.__id__)
      visited << value.__id__ if value.is_a?(Array) || value.is_a?(Hash)

      case value
      when Hash
        !value.frozen? ? value.merge!(value) { |_, v| process v, visited } : value.merge(value) { |_, v| process v, visited }
      when Array
        !value.frozen? ? value.map! { |v| process v, visited } : value.map { |v| process v, visited }
      else
        value
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
sentry-raven-3.0.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.13.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.12.3 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.12.2 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.12.1 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.12.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.11.3 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.11.2 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.11.1 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.11.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.10.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.9.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.8.0 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.7.4 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.7.3 lib/raven/processor/removecircularreferences.rb
jones-gem-2.7.2 lib/raven/processor/removecircularreferences.rb
alec-gem-2.7.2 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.7.2 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.7.1 lib/raven/processor/removecircularreferences.rb
sentry-raven-2.6.3 lib/raven/processor/removecircularreferences.rb