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.



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

def initialize(literal)
  @literal = literal
end

Instance Method Details

#append_regexp(bld) ⇒ Object



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

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

#append_to(bld, ts) ⇒ Object



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

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

#concat(codepoint) ⇒ Object



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

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

#nanosecondsObject



351
352
353
# File 'lib/puppet/pops/time/timespan.rb', line 351

def nanoseconds
  0
end