Class: Nikto::Command::PortList
- Inherits:
-
CommandMapper::Types::Num
- Object
- CommandMapper::Types::Num
- Nikto::Command::PortList
- Defined in:
- lib/nikto/command.rb
Instance Method Summary collapse
Instance Method Details
#format(value) ⇒ Object
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/nikto/command.rb', line 93 def format(value) case value when Array value.map(&method(:format)).join(',') when Range "#{value.begin}-#{value.end}" else super(value) end end |
#validate(value) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/nikto/command.rb', line 62 def validate(value) case value when Array value.each do |element| valid, = validate(element) unless valid return [valid, ] end end return true when Range valid, = super(value.begin) unless valid return [valid, ] end valid, = super(value.end) unless valid return [valid, ] end return true else super(value) end end |