Method: Mustermann::Pattern#peek
- Defined in:
- lib/mustermann/pattern.rb
#peek(string) ⇒ String?
Tries to match the pattern against the beginning of the string (as opposed to the full string). Will return the substring if it matches.
128 129 130 131 |
# File 'lib/mustermann/pattern.rb', line 128 def peek(string) size = peek_size(string) string[0, size] if size end |