Class: Transducers::RandomSampleHandler Private
- Inherits:
-
Object
- Object
- Transducers::RandomSampleHandler
- Defined in:
- lib/transducers.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #call(_) ⇒ Object private
-
#initialize(prob) ⇒ RandomSampleHandler
constructor
private
A new instance of RandomSampleHandler.
Constructor Details
#initialize(prob) ⇒ RandomSampleHandler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RandomSampleHandler.
570 571 572 |
# File 'lib/transducers.rb', line 570 def initialize(prob) @prob = prob end |
Instance Method Details
#call(_) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
574 575 576 |
# File 'lib/transducers.rb', line 574 def call(_) @prob > Random.rand end |