Class: Masscan::Command::RotateTime Private
- Inherits:
-
CommandMapper::Types::Str
- Object
- CommandMapper::Types::Str
- Masscan::Command::RotateTime
- Defined in:
- lib/masscan/command.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents the type for the --rotate
option.
Constant Summary collapse
- REGEXP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Regular expression to validate the
--rotate
time value. /\A(?:\d+|hourly|\d+hours|\d+min)\z/
Instance Method Summary collapse
-
#validate(value) ⇒ true, (false, String)
private
Validates a
--rotate
time value.
Instance Method Details
#validate(value) ⇒ true, (false, String)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Validates a --rotate
time value.
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/masscan/command.rb', line 392 def validate(value) case value when Integer return true else valid, = super(value) unless valid return [valid, ] end string = value.to_s unless string =~ REGEXP return [false, "invalid rotation time (#{value.inspect})"] end return true end end |