Class: Spectre::StringParsing::DigitParser
- Inherits:
-
RangeParser
- Object
- RangeParser
- Spectre::StringParsing::DigitParser
- Defined in:
- lib/spectre/string/primitives.rb
Overview
Matches numeric digits. Shortcut: digit
.
Instance Attribute Summary
Attributes included from Parser
Instance Method Summary collapse
-
#initialize ⇒ DigitParser
constructor
A new instance of DigitParser.
- #inspect ⇒ Object
Methods inherited from RangeParser
Methods included from Parser
#backtrack, #create_match, from_POD, #pre_skip?, #scan, #to_p
Constructor Details
#initialize ⇒ DigitParser
Returns a new instance of DigitParser.
196 197 198 |
# File 'lib/spectre/string/primitives.rb', line 196 def initialize super( ('0'..'9').to_a ) end |
Instance Method Details
#inspect ⇒ Object
200 201 202 |
# File 'lib/spectre/string/primitives.rb', line 200 def inspect "[digit]" end |