Class: Spectre::StringParsing::HexDigitParser

Inherits:
RangeParser
  • Object
show all
Defined in:
lib/spectre/string/primitives.rb

Overview

Matches hexadecimal digits. Shortcut: hex_digit.

Instance Attribute Summary

Attributes included from Parser

#node

Instance Method Summary collapse

Methods inherited from RangeParser

#negation, #scan

Methods included from Parser

#backtrack, #create_match, from_POD, #pre_skip?, #scan, #to_p

Constructor Details

#initializeHexDigitParser

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

#inspectObject



336
337
338
# File 'lib/spectre/string/primitives.rb', line 336

def inspect
    "[hex_digit]"
end