Class: Duration::Nanoseconds

Inherits:
Object
  • Object
show all
Includes:
Common, Relative
Defined in:
lib/Duration/Nanoseconds.rb

Instance Method Summary collapse

Methods included from Relative

#ago, #hence

Methods included from Common

#+, #-, #<=>

Instance Method Details

#to_daysObject



37
38
39
# File 'lib/Duration/Nanoseconds.rb', line 37

def to_days
  to_microseconds.to_days
end

#to_fObject



53
54
55
# File 'lib/Duration/Nanoseconds.rb', line 53

def to_f
  @nanoseconds.to_f
end

#to_hoursObject



33
34
35
# File 'lib/Duration/Nanoseconds.rb', line 33

def to_hours
  to_microseconds.to_hours
end

#to_iObject



49
50
51
# File 'lib/Duration/Nanoseconds.rb', line 49

def to_i
  @nanoseconds.to_i
end

#to_microsecondsObject



17
18
19
# File 'lib/Duration/Nanoseconds.rb', line 17

def to_microseconds
  Duration::Microseconds.new(@nanoseconds / 1000r)
end

#to_millisecondsObject



21
22
23
# File 'lib/Duration/Nanoseconds.rb', line 21

def to_milliseconds
  to_microseconds.to_milliseconds
end

#to_minutesObject



29
30
31
# File 'lib/Duration/Nanoseconds.rb', line 29

def to_minutes
  to_microseconds.to_minutes
end

#to_monthsObject



45
46
47
# File 'lib/Duration/Nanoseconds.rb', line 45

def to_months
  to_microseconds.to_months
end

#to_nanosecondsObject



13
14
15
# File 'lib/Duration/Nanoseconds.rb', line 13

def to_nanoseconds
  self
end

#to_secondsObject



25
26
27
# File 'lib/Duration/Nanoseconds.rb', line 25

def to_seconds
  to_microseconds.to_seconds
end

#to_weeksObject



41
42
43
# File 'lib/Duration/Nanoseconds.rb', line 41

def to_weeks
  to_microseconds.to_weeks
end