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.
337 338 339 |
# File 'lib/puppet/pops/time/timespan.rb', line 337 def initialize(literal) @literal = literal end |
Instance Method Details
#append_regexp(bld) ⇒ Object
333 334 335 |
# File 'lib/puppet/pops/time/timespan.rb', line 333 def append_regexp(bld) bld << "(#{Regexp.escape(@literal)})" end |
#append_to(bld, ts) ⇒ Object
341 342 343 |
# File 'lib/puppet/pops/time/timespan.rb', line 341 def append_to(bld, ts) bld << @literal end |
#concat(codepoint) ⇒ Object
345 346 347 |
# File 'lib/puppet/pops/time/timespan.rb', line 345 def concat(codepoint) @literal.concat(codepoint) end |
#nanoseconds ⇒ Object
349 350 351 |
# File 'lib/puppet/pops/time/timespan.rb', line 349 def nanoseconds 0 end |