Module: DutchFaker::Randomify
- Included in:
- Address
- Defined in:
- lib/dutchfaker/randomify.rb
Instance Method Summary collapse
Instance Method Details
#letterify(letter_string) ⇒ Object
7 8 9 |
# File 'lib/dutchfaker/randomify.rb', line 7 def letterify(letter_string) letter_string.gsub(/\?/) { ('a'..'z').to_a.rand } end |
#numerify(number_string) ⇒ Object
3 4 5 |
# File 'lib/dutchfaker/randomify.rb', line 3 def numerify(number_string) number_string.gsub(/#/) { rand(10).to_s } end |