class WeighedDistribution::Mapped
@!visibility private
Public Class Methods
new(source, &map)
click to toggle source
@api private @note Used by {WeighedDistribution#map} only.
# File lib/weighed_distribution.rb, line 99 def initialize(source, &map) @source = source @map = map end
Public Instance Methods
sample(*args)
click to toggle source
(see WeighedDistribution#sample
)
# File lib/weighed_distribution.rb, line 105 def sample(*args) @map.(@source.sample(*args)) end