Class: Org::StringScanner
- Inherits:
-
StringScanner
- Object
- StringScanner
- Org::StringScanner
- Defined in:
- lib/org/stringscanner.rb
Overview
Adding some comfort
Instance Method Summary collapse
-
#captures ⇒ Object
Equivalent to Regexp#captures, returns Array of all matches.
Instance Method Details
#captures ⇒ Object
Equivalent to Regexp#captures, returns Array of all matches
7 8 9 10 11 12 13 14 |
# File 'lib/org/stringscanner.rb', line 7 def captures n = 0 found = [] while n += 1 return found unless element = self[n] found << element end end |