Class: Duration::Nanoseconds
- Inherits:
-
Object
- Object
- Duration::Nanoseconds
- Defined in:
- lib/Duration/Nanoseconds.rb
Instance Method Summary collapse
- #to_days ⇒ Object
- #to_f ⇒ Object
- #to_hours ⇒ Object
- #to_i ⇒ Object
- #to_microseconds ⇒ Object
- #to_milliseconds ⇒ Object
- #to_minutes ⇒ Object
- #to_months ⇒ Object
- #to_nanoseconds ⇒ Object
- #to_seconds ⇒ Object
- #to_weeks ⇒ Object
Methods included from Relative
Methods included from Common
Instance Method Details
#to_days ⇒ Object
37 38 39 |
# File 'lib/Duration/Nanoseconds.rb', line 37 def to_days to_microseconds.to_days end |
#to_f ⇒ Object
53 54 55 |
# File 'lib/Duration/Nanoseconds.rb', line 53 def to_f @nanoseconds.to_f end |
#to_hours ⇒ Object
33 34 35 |
# File 'lib/Duration/Nanoseconds.rb', line 33 def to_hours to_microseconds.to_hours end |
#to_i ⇒ Object
49 50 51 |
# File 'lib/Duration/Nanoseconds.rb', line 49 def to_i @nanoseconds.to_i end |
#to_microseconds ⇒ Object
17 18 19 |
# File 'lib/Duration/Nanoseconds.rb', line 17 def to_microseconds Duration::Microseconds.new(@nanoseconds / 1000r) end |
#to_milliseconds ⇒ Object
21 22 23 |
# File 'lib/Duration/Nanoseconds.rb', line 21 def to_milliseconds to_microseconds.to_milliseconds end |
#to_minutes ⇒ Object
29 30 31 |
# File 'lib/Duration/Nanoseconds.rb', line 29 def to_minutes to_microseconds.to_minutes end |
#to_months ⇒ Object
45 46 47 |
# File 'lib/Duration/Nanoseconds.rb', line 45 def to_months to_microseconds.to_months end |
#to_nanoseconds ⇒ Object
13 14 15 |
# File 'lib/Duration/Nanoseconds.rb', line 13 def to_nanoseconds self end |
#to_seconds ⇒ Object
25 26 27 |
# File 'lib/Duration/Nanoseconds.rb', line 25 def to_seconds to_microseconds.to_seconds end |
#to_weeks ⇒ Object
41 42 43 |
# File 'lib/Duration/Nanoseconds.rb', line 41 def to_weeks to_microseconds.to_weeks end |