Module: IntegerExtensions
- Included in:
- Integer
- Defined in:
- lib/extensions/integer_extensions.rb
Overview
Integer extensions
Instance Method Summary collapse
-
#days ⇒ Object
Public: Converts days to milliseconds.
-
#hr ⇒ Object
Public: Converts hours to milliseconds.
-
#min ⇒ Object
Public: Converts minutes to milliseconds.
-
#ms ⇒ Object
Public: Decorator for milliseconds.
-
#sec ⇒ Object
Public: Converts seconds to milliseconds.
Instance Method Details
#days ⇒ Object
Public: Converts days to milliseconds.
Returns the value in milliseconds.
36 37 38 |
# File 'lib/extensions/integer_extensions.rb', line 36 def days self.to_f.days end |
#hr ⇒ Object
Public: Converts hours to milliseconds.
Returns the value in milliseconds.
29 30 31 |
# File 'lib/extensions/integer_extensions.rb', line 29 def hr self.to_f.hr end |
#min ⇒ Object
Public: Converts minutes to milliseconds.
Returns the value in milliseconds.
22 23 24 |
# File 'lib/extensions/integer_extensions.rb', line 22 def min self.to_f.min end |
#ms ⇒ Object
Public: Decorator for milliseconds.
Returns the value.
8 9 10 |
# File 'lib/extensions/integer_extensions.rb', line 8 def ms self end |
#sec ⇒ Object
Public: Converts seconds to milliseconds.
Returns the value in milliseconds.
15 16 17 |
# File 'lib/extensions/integer_extensions.rb', line 15 def sec self.to_f.sec end |