Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/ubsafe/extensions/ubsafe_integer_extensions.rb
Instance Method Summary collapse
- #days ⇒ Object (also: #day)
- #hours ⇒ Object (also: #hour)
- #mins ⇒ Object (also: #min)
- #months ⇒ Object (also: #month)
- #seconds ⇒ Object (also: #second)
- #weeks ⇒ Object (also: #week)
- #years ⇒ Object (also: #year)
Instance Method Details
#days ⇒ Object Also known as: day
21 22 23 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 21 def days return self.hours * 24 end |
#hours ⇒ Object Also known as: hour
15 16 17 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 15 def hours return self.mins * 60 end |
#mins ⇒ Object Also known as: min
9 10 11 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 9 def mins return self.to_i * 60 end |
#months ⇒ Object Also known as: month
33 34 35 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 33 def months return self.days * 30 end |
#seconds ⇒ Object Also known as: second
3 4 5 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 3 def seconds return self.to_i end |
#weeks ⇒ Object Also known as: week
27 28 29 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 27 def weeks return self.days * 7 end |
#years ⇒ Object Also known as: year
39 40 41 |
# File 'lib/ubsafe/extensions/ubsafe_integer_extensions.rb', line 39 def years return self.days * 365 end |