Module: Randomly
- Defined in:
- lib/version.rb,
lib/randomly.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
Class Method Details
.generate(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/randomly.rb', line 3 def self.generate( = {}) = { :length => 8, :chars => ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a }.merge!() Array.new([:length]) { [:chars].to_a[rand([:chars].to_a.size)] }.join end |