Sha256: 7b41799a276415b7c36974801d60f056e9253770396d1146d25fcba3a0a90fa8

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 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

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].freeze
    end

    def source=( s )
        @source = (s ? s.recode.freeze : s)
    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

6 entries across 6 versions & 1 rubygems

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