Sha256: fb9d114f4d2d9583e76482c39ac1624422fde851c651bbdcf6eb00a994747cb8

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

=begin
    Copyright 2010-2022 Ecsypno <http://www.ecsypno.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

module Arachni
module Element::Capabilities

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

    class Error < Arachni::Element::Error
        class MissingSource < Error
        end
    end

    # @return   [String]
    #   Source for the element.
    attr_accessor :source

    def initialize( options )
        super
        self.source = options[:source]
    end

    def source=( s )
        @source = (s ? s.strip : s.freeze )
    end

    def to_h
        super.merge( source: source )
    end

    def to_rpc_data
        super.merge( 'source' => @source )
    end

    def dup
        copy_with_source( super )
    end

    private

    def copy_with_source( other )
        other.source = @source
        other
    end

end

end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arachni-1.6.1.3 lib/arachni/element/capabilities/with_source.rb
arachni-1.6.1.2 lib/arachni/element/capabilities/with_source.rb
arachni-1.6.1.1 lib/arachni/element/capabilities/with_source.rb
arachni-1.6.1 lib/arachni/element/capabilities/with_source.rb
arachni-1.6.0 lib/arachni/element/capabilities/with_source.rb