Module: RubyCoreExtensions::String::MatchAll

Defined in:
lib/ruby_core_extensions/string/match_all.rb

Instance Method Summary collapse

Instance Method Details

#match_all(pattern) ⇒ Object

Raises:

  • (ArgumentError)


4
5
6
7
8
# File 'lib/ruby_core_extensions/string/match_all.rb', line 4

def match_all(pattern)
  raise ArgumentError, "must pass a Regexp pattern" unless pattern.is_a?(Regexp)

  recursive_match(pattern)
end