Class: Puppet::Pops::Time::Timespan::Format::LiteralSegment
- Defined in:
- lib/puppet/pops/time/timespan.rb
Instance Method Summary collapse
- #append_regexp(bld) ⇒ Object
- #append_to(bld, ts) ⇒ Object
- #concat(codepoint) ⇒ Object
-
#initialize(literal) ⇒ LiteralSegment
constructor
A new instance of LiteralSegment.
- #nanoseconds ⇒ Object
Methods inherited from Segment
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 |
#nanoseconds ⇒ Object
351 352 353 |
# File 'lib/puppet/pops/time/timespan.rb', line 351 def nanoseconds 0 end |