Sha256: e6fb1de51e234229fbac614dae52f9e53d243333d547f0b481de81ade060c19d

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

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

cs__scoped_require 'set'
cs__scoped_require 'base64'
cs__scoped_require 'contrast/utils/tag_util'
cs__scoped_require 'contrast/utils/prevent_serialization'

module Contrast
  module Agent
    module Assess
      # This class is used as an NoOP version of Properties. We'll pass this to
      # any attempt to access Properties on a frozen object including
      # AssessExtension iff that object did not have Properties before it was
      # placed in a frozen state.
      class FrozenProperties
        include Contrast::Utils::PreventSerialization

        def events
          Contrast::Utils::ObjectShare::EMPTY_ARRAY
        end

        def properties
          Contrast::Utils::ObjectShare::EMPTY_HASH
        end

        def tracked?
          false
        end

        def tagged? _label
          false
        end

        def any_tags_between? _start, _finish
          false
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contrast-agent-3.10.2 lib/contrast/agent/assess/frozen_properties.rb
contrast-agent-3.10.1 lib/contrast/agent/assess/frozen_properties.rb
contrast-agent-3.10.0 lib/contrast/agent/assess/frozen_properties.rb
contrast-agent-3.9.1 lib/contrast/agent/assess/frozen_properties.rb
contrast-agent-3.9.0 lib/contrast/agent/assess/frozen_properties.rb
contrast-agent-3.8.5 lib/contrast/agent/assess/frozen_properties.rb
contrast-agent-3.8.4 lib/contrast/agent/assess/frozen_properties.rb