Class: Spectre::StringParsing::AlphaParser

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

Overview

Matches any alphabetic character. Shortcut: alpha_char.

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

#initializeAlphaParser

Returns a new instance of AlphaParser.



154
155
156
# File 'lib/spectre/string/primitives.rb', line 154

def initialize
    super( ('a'..'z').to_a + ('A'..'Z').to_a )
end

Instance Method Details

#inspectObject



158
159
160
# File 'lib/spectre/string/primitives.rb', line 158

def inspect
    "[alpha_char]"
end