Class: Randgen

Inherits:
Object
  • Object
show all
Defined in:
lib/attributor/types/uri.rb,
lib/attributor/extensions/randexp.rb

Constant Summary collapse

DATE_TIME_EPOCH =
::DateTime.new(2015, 1, 1, 0, 0, 0)

Class Method Summary collapse

Class Method Details

.dateObject



6
7
8
# File 'lib/attributor/extensions/randexp.rb', line 6

def self.date
  DATE_TIME_EPOCH - rand(800)
end

.timeObject



10
11
12
# File 'lib/attributor/extensions/randexp.rb', line 10

def self.time
  date.to_time
end

.uriObject



71
72
73
# File 'lib/attributor/types/uri.rb', line 71

def self.uri
  "http://example.com/#{word}/#{rand(10**9)}"
end