Class: Arachni::Component::Options::Path

Inherits:
Base show all
Defined in:
lib/arachni/component/options/path.rb

Overview

Network address option.

Instance Attribute Summary

Attributes inherited from Base

#default, #desc, #enums, #name

Instance Method Summary collapse

Methods inherited from Base

#==, #empty_required_value?, #initialize, #normalize, #required?, #to_h, #type?

Constructor Details

This class inherits a constructor from Arachni::Component::Options::Base

Instance Method Details

#typeObject



23
24
25
# File 'lib/arachni/component/options/path.rb', line 23

def type
    'path'
end

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
# File 'lib/arachni/component/options/path.rb', line 27

def valid?( value )
    return false if empty_required_value?( value )

    if value && !value.empty? && !File.exists?( value )
        return false
    end

    super
end