Class: Nmap::Command::HexString Private
- Inherits:
-
CommandMapper::Types::Str
- Object
- CommandMapper::Types::Str
- Nmap::Command::HexString
- Defined in:
- lib/nmap/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 a hex string.
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.
/\A(?:(?:0x)?[0-9A-F]+|(?:\\x[0-9A-F]{2})+)\z/
Instance Method Summary collapse
-
#validate(value) ⇒ true, (false, String)
private
Validates a hex string 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 hex string value.
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/nmap/command.rb', line 498 def validate(value) valid, = super(value) unless valid return [valid, ] end value = value.to_s unless value =~ REGEXP return [false, "must be of the format 0xAABBCCDDEEFF..., AABBCCDDEEFF..., or \\xAA\\xBB\\xCC\\xDD\\xEE\\xFF..."] end return true end |