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

Inherits:
Object
  • Object
show all
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

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

Class Method Details

.singletonObject


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