Class: Puppet::Pops::Time::Timespan::FormatParser
- 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
-
#initialize ⇒ FormatParser
constructor
A new instance of FormatParser.
- #parse_format(format) ⇒ Object
Methods included from Concurrent::ThreadLocalSingleton
Constructor Details
#initialize ⇒ FormatParser
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 |