Sha256: 977a10eecb3a8ae66e15ace97c2f2268ac06722a3bf4a8cc475a9193001238f3
Contents?: true
Size: 475 Bytes
Versions: 4
Compression:
Stored size: 475 Bytes
Contents
require 'date' module RandomData # Defines methods for random date generation module Dates # Returns a date within a specified range of days (plus or minus half what you specify). The default is ten days, so by default you will # get a date within plus or minus five days of today. # # Example: # # >> Random.date.to_s = "2007-09-16" def date(dayrange=10) (Date.today + (rand(dayrange*2) - dayrange)) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
random_data-1.0.1 | lib/random_data/dates.rb |
random_data-1.0.2 | lib/random_data/dates.rb |
random_data-1.1.0 | lib/random_data/dates.rb |
random_data-1.0.0 | lib/random_data/dates.rb |