Class: Puppet::Pops::Time::Timespan::Format::LiteralSegment

Inherits:
Segment
  • Object
show all
Defined in:
lib/puppet/pops/time/timespan.rb

Instance Method Summary collapse

Methods inherited from Segment

#multiplier

Constructor Details

#initialize(literal) ⇒ LiteralSegment

Returns a new instance of LiteralSegment.



334
335
336
# File 'lib/puppet/pops/time/timespan.rb', line 334

def initialize(literal)
  @literal = literal
end

Instance Method Details

#append_regexp(bld) ⇒ Object



330
331
332
# File 'lib/puppet/pops/time/timespan.rb', line 330

def append_regexp(bld)
  bld << "(#{Regexp.escape(@literal)})"
end

#append_to(bld, ts) ⇒ Object



338
339
340
# File 'lib/puppet/pops/time/timespan.rb', line 338

def append_to(bld, ts)
  bld << @literal
end

#concat(codepoint) ⇒ Object



342
343
344
# File 'lib/puppet/pops/time/timespan.rb', line 342

def concat(codepoint)
  @literal.concat(codepoint)
end

#nanosecondsObject



346
347
348
# File 'lib/puppet/pops/time/timespan.rb', line 346

def nanoseconds
  0
end