Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/sinatra-hat.rb
Instance Method Summary collapse
- #ago ⇒ Object
- #day ⇒ Object (also: #days)
- #hour ⇒ Object (also: #hours)
- #minute ⇒ Object (also: #minutes)
- #month ⇒ Object (also: #months)
- #week ⇒ Object (also: #weeks)
- #year ⇒ Object (also: #years)
Instance Method Details
#ago ⇒ Object
29 30 31 |
# File 'lib/sinatra-hat.rb', line 29 def ago Time.now - self end |
#day ⇒ Object Also known as: days
13 14 15 |
# File 'lib/sinatra-hat.rb', line 13 def day hour * 24 end |
#hour ⇒ Object Also known as: hours
9 10 11 |
# File 'lib/sinatra-hat.rb', line 9 def hour minute * 60 end |
#minute ⇒ Object Also known as: minutes
5 6 7 |
# File 'lib/sinatra-hat.rb', line 5 def minute self * 60 end |
#month ⇒ Object Also known as: months
21 22 23 |
# File 'lib/sinatra-hat.rb', line 21 def month day * 30 end |
#week ⇒ Object Also known as: weeks
17 18 19 |
# File 'lib/sinatra-hat.rb', line 17 def week day * 7 end |
#year ⇒ Object Also known as: years
25 26 27 |
# File 'lib/sinatra-hat.rb', line 25 def year day * 365 end |