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.
39 40 41 |
# File 'lib/regexp-examples/max_results_limiter.rb', line 39 def initialize super(1) end |
Instance Method Details
#limit_results(partial_results) ⇒ Object
43 44 45 |
# File 'lib/regexp-examples/max_results_limiter.rb', line 43 def limit_results(partial_results) super(partial_results, :/, :*) end |