Method: MatchData#each

Defined in:
lib/mug/matchdata/each.rb

#each(&_b) ⇒ Object

Iterates over each capture group in the MatchData object, including $& (the entire matched string), yielding the captured string.



7
8
9
10
# File 'lib/mug/matchdata/each.rb', line 7

def each &_b
  return enum_for(:each) unless block_given?
  to_a.each{|v| yield v }
end