Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra-hat.rb

Instance Method Summary collapse

Instance Method Details

#agoObject



29
30
31
# File 'lib/sinatra-hat.rb', line 29

def ago
  Time.now - self
end

#dayObject Also known as: days



13
14
15
# File 'lib/sinatra-hat.rb', line 13

def day
  hour * 24 
end

#hourObject Also known as: hours



9
10
11
# File 'lib/sinatra-hat.rb', line 9

def hour
  minute * 60
end

#minuteObject Also known as: minutes



5
6
7
# File 'lib/sinatra-hat.rb', line 5

def minute
  self * 60
end

#monthObject Also known as: months



21
22
23
# File 'lib/sinatra-hat.rb', line 21

def month
  day * 30
end

#weekObject Also known as: weeks



17
18
19
# File 'lib/sinatra-hat.rb', line 17

def week
  day * 7
end

#yearObject Also known as: years



25
26
27
# File 'lib/sinatra-hat.rb', line 25

def year
  day * 365
end