Class: Puppet::Pops::Time::Timespan::Format::HourSegment

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) ⇒ HourSegment

Returns a new instance of HourSegment.



431
432
433
# File 'lib/puppet/pops/time/timespan.rb', line 431

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

Instance Method Details

#append_to(bld, ts) ⇒ Object



439
440
441
# File 'lib/puppet/pops/time/timespan.rb', line 439

def append_to(bld, ts)
  append_value(bld, use_total? ? ts.total_hours : ts.hours)
end

#multiplierObject



435
436
437
# File 'lib/puppet/pops/time/timespan.rb', line 435

def multiplier
  NSECS_PER_HOUR
end