Class: Puppet::Pops::Time::Timespan::FormatParser

Inherits:
Object
  • Object
show all
Extended by:
Concurrent::ThreadLocalSingleton
Defined in:
lib/puppet/pops/time/timespan.rb

Overview

Parses a string into a Timestamp::Format instance

Instance Method Summary collapse

Methods included from Concurrent::ThreadLocalSingleton

singleton

Constructor Details

#initializeFormatParser

Returns a new instance of FormatParser.



595
596
597
# File 'lib/puppet/pops/time/timespan.rb', line 595

def initialize
  @formats = Hash.new { |hash, str| hash[str] = internal_parse(str) }
end

Instance Method Details

#parse_format(format) ⇒ Object



599
600
601
# File 'lib/puppet/pops/time/timespan.rb', line 599

def parse_format(format)
  @formats[format]
end