Class: Arachni::OptPort
- Defined in:
- lib/arachni/component_options.rb
Overview
Network port option.
Instance Attribute Summary
Attributes inherited from OptBase
#default, #desc, #enums, #name, #owner, #required
Instance Method Summary collapse
Methods inherited from OptBase
#empty_required_value?, #initialize, #normalize, #required?, #to_h, #type?
Constructor Details
This class inherits a constructor from Arachni::OptBase
Instance Method Details
#type ⇒ Object
272 273 274 |
# File 'lib/arachni/component_options.rb', line 272 def type return 'port' end |
#valid?(value) ⇒ Boolean
276 277 278 279 280 281 282 283 284 285 |
# File 'lib/arachni/component_options.rb', line 276 def valid?(value) return false if empty_required_value?(value) if ((value != nil and value.to_s.empty? == false) and ((value.to_s.match(/^\d+$/) == nil or value.to_i < 0 or value.to_i > 65535))) return false end return super end |