daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @value_pool = { :text => ('A'..'Z').to_a + ('a'..'z').to_a, :numeric => (0..100).to_a}
  2.  
  3.   def random_letter
  4.     @value_pool[:text][rand(@value_pool[:text].size)]
  5.   end
  6.  
  7.   def random_number
  8.     @value_pool[:numeric][rand(@value_pool[:numeric].size)]
  9.   end
  10.  
  11.   def make_string_of_length(range)
  12.     sized_string = ""
  13.     sized_string += random_letter while sized_string.length < range.first
  14.     return sized_string
  15.   end
RAW Paste Data
Top