Sha256: b7addf537f10fe8c9f277f3334074c8cde7e2d2a203d67d146628a25aea120b0

Contents?: true

Size: 510 Bytes

Versions: 10

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true

class LHC::BodyScrubber < LHC::Scrubber
  def initialize(data)
    super(data)
    parse!
    scrub!
  end

  private

  def scrub_elements
    LHC.config.scrubs[:body]
  end

  def parse!
    return if scrubbed.nil? || scrubbed.is_a?(Hash) || scrubbed.is_a?(Array)

    if scrubbed.is_a?(String)
      json = scrubbed
    else
      json = scrubbed.to_json
    end

    parsed = JSON.parse(json)
    self.scrubbed = parsed if parsed.is_a?(Hash) || parsed.is_a?(Array)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lhc-15.2.1 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.2.0 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.1.3 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.1.2 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.1.1 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.1.0 lib/lhc/scrubbers/body_scrubber.rb
lhc-16.0.0.pre.pro2162.2 lib/lhc/scrubbers/body_scrubber.rb
lhc-16.0.0.pre.pro2162 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.0.1 lib/lhc/scrubbers/body_scrubber.rb
lhc-15.0.0 lib/lhc/scrubbers/body_scrubber.rb