Sha256: cade8451c3413a6e02ec6bc2e6412ea739c97ca9dcfbad51801b680be7c4dee2

Contents?: true

Size: 1.28 KB

Versions: 7

Compression:

Stored size: 1.28 KB

Contents

=begin
    Copyright 2010-2014 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

7 entries across 7 versions & 1 rubygems

Version Path
arachni-1.0.6 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.0.5 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.0.4 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.0.3 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.0.2 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.0.1 lib/arachni/element/capabilities/with_auditor.rb
arachni-1.0 lib/arachni/element/capabilities/with_auditor.rb