Class: Spectre::StringParsing::HexDigitParser
- Inherits:
-
RangeParser
- Object
- RangeParser
- Spectre::StringParsing::HexDigitParser
- Defined in:
- lib/spectre/string/primitives.rb
Overview
Matches hexadecimal digits. Shortcut: hex_digit
.
Instance Attribute Summary
Attributes included from Parser
Instance Method Summary collapse
-
#initialize ⇒ HexDigitParser
constructor
A new instance of HexDigitParser.
- #inspect ⇒ Object
Methods inherited from RangeParser
Methods included from Parser
#backtrack, #create_match, from_POD, #pre_skip?, #scan, #to_p
Constructor Details
#initialize ⇒ HexDigitParser
Returns a new instance of HexDigitParser.
332 333 334 |
# File 'lib/spectre/string/primitives.rb', line 332 def initialize super( ('0'..'9').to_a + ('a'..'f').to_a + ('A'..'F').to_a ) end |
Instance Method Details
#inspect ⇒ Object
336 337 338 |
# File 'lib/spectre/string/primitives.rb', line 336 def inspect "[hex_digit]" end |