Sha256: 0d4a61e6447629927461b4d33a256fd8f8b95f78b654860f0e8ab1641d7d4e68

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 KB

Contents

=begin
    Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

require_relative 'with_auditor/output'

module Arachni
module Element::Capabilities

# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
module WithAuditor
    include Output

    # Sets the auditor for this element.
    #
    # The auditor provides its output, HTTP and issue logging interfaces.
    #
    # @return   [Arachni::Check::Auditor]
    attr_accessor :auditor

    # Removes the {#auditor} from this element.
    def remove_auditor
        self.auditor = nil
    end

    # Removes the associated {#auditor}.
    def prepare_for_report
        super if defined? super
        remove_auditor
    end

    # @return   [Bool]
    #   `true` if it has no auditor, `false` otherwise.
    def orphan?
        !auditor
    end

    def dup
        copy_with_auditor( super )
    end

    def marshal_dump
        super.tap { |h| h.delete :@auditor }
    end

    private

    def copy_with_auditor( other )
        other.auditor = self.auditor
        other
    end

end

end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arachni-1.3.2 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.3.1 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.3 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.2.1 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.2 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.1 lib/arachni/element/capabilities/with_auditor.rb