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.


336
337
338
# File 'lib/puppet/pops/time/timespan.rb', line 336

def initialize(literal)
  @literal = literal
end

Instance Method Details

#append_regexp(bld) ⇒ Object


332
333
334
# File 'lib/puppet/pops/time/timespan.rb', line 332

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

#append_to(bld, ts) ⇒ Object


340
341
342
# File 'lib/puppet/pops/time/timespan.rb', line 340

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

#concat(codepoint) ⇒ Object


344
345
346
# File 'lib/puppet/pops/time/timespan.rb', line 344

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

#nanosecondsObject


348
349
350
# File 'lib/puppet/pops/time/timespan.rb', line 348

def nanoseconds
  0
end