Sha256: 4c2490340d30675e45a2be385b9e73f1e40302a738291bb7864becd4c2cd09fd

Contents?: true

Size: 737 Bytes

Versions: 8

Compression:

Stored size: 737 Bytes

Contents

# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

module Contrast
  module Agent
    module Protect
      module Rule
        module InputClassification
          # Utils module for Input Classification.
          module Utils
            # Extracts data return as array from the cache.
            #
            # @param object [NilClass, Array<Contrast::Agent::Protect::InputClassification::CachedResult>]
            # @return object [Contrast::Agent::Protect::InputClassification::CachedResult]
            def safe_extract object
              Array(object)[0]
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.6.0 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.5.0 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.4.1 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.4.0 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.3.2 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.3.1 lib/contrast/agent/protect/rule/input_classification/utils.rb
contrast-agent-7.3.0 lib/contrast/agent/protect/rule/input_classification/utils.rb