Class: RegexpExamples::MaxResultsLimiterByProduct
- Inherits:
-
MaxResultsLimiter
- Object
- MaxResultsLimiter
- RegexpExamples::MaxResultsLimiterByProduct
- Defined in:
- lib/regexp-examples/max_results_limiter.rb
Overview
For example: Needed when generating examples for /[ab]10/ (here, results_count will reach 2**10 == 1024)
Instance Method Summary collapse
-
#initialize ⇒ MaxResultsLimiterByProduct
constructor
A new instance of MaxResultsLimiterByProduct.
- #limit_results(partial_results) ⇒ Object
Constructor Details
#initialize ⇒ MaxResultsLimiterByProduct
Returns a new instance of MaxResultsLimiterByProduct.
37 38 39 |
# File 'lib/regexp-examples/max_results_limiter.rb', line 37 def initialize super(1) end |
Instance Method Details
#limit_results(partial_results) ⇒ Object
41 42 43 |
# File 'lib/regexp-examples/max_results_limiter.rb', line 41 def limit_results(partial_results) super(partial_results, :/, :*) end |