Class: Puppet::Pops::Time::Timespan::FormatParser
- Defined in:
- lib/puppet/pops/time/timespan.rb
Overview
Parses a string into a Timestamp::Format instance
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ FormatParser
constructor
A new instance of FormatParser.
- #parse_format(format) ⇒ Object
Constructor Details
#initialize ⇒ FormatParser
Returns a new instance of FormatParser.
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 |
Class Method Details
.singleton ⇒ Object
584 585 586 |
# File 'lib/puppet/pops/time/timespan.rb', line 584 def self.singleton @singleton 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 |