Sha256: b7ae689be9e2e9180c9ead8662f9928bbc09f1a52c13cb18797928f4b26d6fcd

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

module Arachni::Element
class Cookie
module Capabilities

# Extends {Arachni::Element::Capabilities::Inputtable} with {Cookie}-specific
# functionality.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
module Inputtable
    include Arachni::Element::Capabilities::Inputtable

    # @example
    #    p c = Cookie.from_set_cookie( 'http://owner-url.com', 'session=stuffstuffstuff' ).first
    #    #=> ["session=stuffstuffstuff"]
    #
    #    p c.inputs
    #    #=> {"session"=>"stuffstuffstuff"}
    #
    #    p c.inputs = { 'new-name' => 'new-value' }
    #    #=> {"new-name"=>"new-value"}
    #
    #    p c
    #    #=> new-name=new-value
    #
    # @param    [Hash]  inputs
    #   Sets inputs.
    def inputs=( inputs )
        k = inputs.keys.first.to_s
        v = inputs.values.first.to_s

        @data[:name]  = k
        @data[:value] = v

        if k.to_s.empty?
            super( {} )
        else
            super( { k => v } )
        end
    end

end

end
end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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