Module: CoreExtensions::Regexp::Examples
- Defined in:
- lib/core_extensions/regexp/examples.rb
Overview
A wrapper module to namespace/isolate the Regexp#examples and Regexp#random_exanple monkey patches. No core classes are extended in any way, other than the above two methods.
Instance Method Summary collapse
Instance Method Details
#examples(**config_options) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/core_extensions/regexp/examples.rb', line 7 def examples(**) RegexpExamples::ResultCountLimiters.configure!( [:max_repeater_variance], [:max_group_results] ) examples_by_method(:map_results) end |
#random_example(**config_options) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/core_extensions/regexp/examples.rb', line 15 def random_example(**) RegexpExamples::ResultCountLimiters.configure!( [:max_repeater_variance] ) examples_by_method(:map_random_result).first end |