Sha256: c2785d4d2ee9de9b3eecbe6311772cc66697e0acd0d3df15412786497f004edd
Contents?: true
Size: 375 Bytes
Versions: 38
Compression:
Stored size: 375 Bytes
Contents
module Pacer module Core module Route # Return elements based on a bias:1 chance. # # If given an integer (n) > 0, bias is calcualated at 1 / n. def random(bias = 0.5) bias = 1 / bias.to_f if bias.is_a? Fixnum and bias > 0 chain_route :pipe_class => Pacer::Pipes::RandomFilterPipe, :pipe_args => bias end end end end
Version data entries
38 entries across 38 versions & 1 rubygems