Class: Puppet::Pops::Time::Timespan::Format::SecondSegment

Inherits:
ValueSegment show all
Defined in:
lib/puppet/pops/time/timespan.rb

Instance Method Summary collapse

Methods inherited from ValueSegment

#append_regexp, #append_value, #create_format, #nanoseconds, #set_use_total, #use_total?

Methods inherited from Segment

#append_regexp

Constructor Details

#initialize(padchar, width) ⇒ SecondSegment

Returns a new instance of SecondSegment.



462
463
464
# File 'lib/puppet/pops/time/timespan.rb', line 462

def initialize(padchar, width)
  super(padchar, width, 2)
end

Instance Method Details

#append_to(bld, ts) ⇒ Object



470
471
472
# File 'lib/puppet/pops/time/timespan.rb', line 470

def append_to(bld, ts)
  append_value(bld, use_total? ? ts.total_seconds : ts.seconds)
end

#multiplierObject



466
467
468
# File 'lib/puppet/pops/time/timespan.rb', line 466

def multiplier
  NSECS_PER_SEC
end