class Puppet::Pops::Time::Timespan::Format::NanoSecondSegment
Public Class Methods
new(padchar, width)
click to toggle source
Calls superclass method
Puppet::Pops::Time::Timespan::Format::ValueSegment::new
# File lib/puppet/pops/time/timespan.rb 515 def initialize(padchar, width) 516 super(padchar, width, 9) 517 end
Public Instance Methods
append_to(bld, ts)
click to toggle source
# File lib/puppet/pops/time/timespan.rb 528 def append_to(bld, ts) 529 ns = ts.total_nanoseconds 530 width = @width || @default_width 531 if width < 9 532 # Truncate digits to the right, i.e. let %6N reflect microseconds 533 ns /= 10 ** (9 - width) 534 ns %= 10 ** width unless use_total? 535 else 536 ns %= NSECS_PER_SEC unless use_total? 537 end 538 append_value(bld, ns) 539 end
multiplier()
click to toggle source
# File lib/puppet/pops/time/timespan.rb 519 def multiplier 520 width = @width || @default_width 521 if width < 9 522 10 ** (9 - width) 523 else 524 1 525 end 526 end