Class: Ape::SamplesContext

Inherits:
Erubis::Context
  • Object
show all
Defined in:
lib/ape/samples.rb

Instance Method Summary collapse

Instance Method Details

#idObject



13
14
15
16
17
# File 'lib/ape/samples.rb', line 13

def id
  id = ''
  5.times { id += rand(1000000).to_s }
  "tag:tbray.org,2005:#{id}"
end

#nowObject



10
11
12
# File 'lib/ape/samples.rb', line 10

def now
  DateTime::now.strftime("%Y-%m-%dT%H:%M:%S%z").sub(/(..)$/, ':\1')
end