Class: UUID
- Inherits:
-
Object
- Object
- UUID
- Defined in:
- lib/clarity_tracking_number/ruby_core_extensions.rb
Class Method Summary collapse
- .clear_bank_tracking_number ⇒ Object
- .clear_check_tracking_number ⇒ Object
- .random_string(n = 10) ⇒ Object
- .random_tracking_number ⇒ Object
Class Method Details
.clear_bank_tracking_number ⇒ Object
23 24 25 |
# File 'lib/clarity_tracking_number/ruby_core_extensions.rb', line 23 def self.clear_bank_tracking_number random_string(10) end |
.clear_check_tracking_number ⇒ Object
19 20 21 |
# File 'lib/clarity_tracking_number/ruby_core_extensions.rb', line 19 def self.clear_check_tracking_number random_string(6) end |
.random_string(n = 10) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/clarity_tracking_number/ruby_core_extensions.rb', line 2 def self.random_string(n=10) max = 32**n @chars = ('a'..'z').to_a + ('0'..'9').to_a - ['i', 'l', 'o', 'u'] ans = '' r = rand(max) n.times do i = r % 32 r /= 32 ans << @chars[i] end ans end |
.random_tracking_number ⇒ Object
15 16 17 |
# File 'lib/clarity_tracking_number/ruby_core_extensions.rb', line 15 def self.random_tracking_number random_string(10) end |