Method: Symbol.random
- Defined in:
- lib/propr/random/symbol.rb
.random(options = {}, m = Propr::Random) ⇒ Object
@note: Beware of memory consumption. Symbols are never garbage collected, and we’re generating them at random!
5 6 7 8 9 10 11 12 |
# File 'lib/propr/random/symbol.rb', line 5 def random( = {}, m = Propr::Random) min = [:min] || 0 max = [:max] || 10 = Hash[charset: /[a-z_]/] m.bind(String.random()) do |s| m.unit(s.to_sym) end end |