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


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

def self.date
  return DATE_TIME_EPOCH - rand(800)
end

.timeObject


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

def self.time
  return date.to_time
end

.uriObject


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

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