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


588
589
590
# File 'lib/puppet/pops/time/timespan.rb', line 588

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

Instance Method Details

#parse_format(format) ⇒ Object


592
593
594
# File 'lib/puppet/pops/time/timespan.rb', line 592

def parse_format(format)
  @formats[format]
end