Module: FloatExtensions

Included in:
Float
Defined in:
lib/extensions/float_extensions.rb

Overview

Float extensions

Instance Method Summary collapse

Instance Method Details

#days ⇒ Object

Public: Converts days to milliseconds.

Returns the value in milliseconds.



29
30
31
# File 'lib/extensions/float_extensions.rb', line 29

def days
  hr * 24
end

#hr ⇒ Object

Public: Converts hours to milliseconds.

Returns the value in milliseconds.



22
23
24
# File 'lib/extensions/float_extensions.rb', line 22

def hr
  min * 60
end

#min ⇒ Object

Public: Converts minutes to milliseconds.

Returns the value in milliseconds.



15
16
17
# File 'lib/extensions/float_extensions.rb', line 15

def min
  sec * 60
end

#sec ⇒ Object

Public: Converts seconds to milliseconds.

Returns the value in milliseconds.



8
9
10
# File 'lib/extensions/float_extensions.rb', line 8

def sec
  (self * 1000).round
end