Sha256: 04ed4c90e4edfa6bef26830ee8722d381e0da1120b2a268e0f448e0c00c7e0c7

Contents?: true

Size: 405 Bytes

Versions: 4

Compression:

Stored size: 405 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    class Timezone < BaseResolver
      init_resolver

      class << self
        private

        def post_resolve(fact_name)
          @fact_list.fetch(fact_name) { determine_timezone }
        end

        def determine_timezone
          @fact_list[:timezone] = Time.now.localtime.strftime('%Z')
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facter-4.0.49 lib/facter/resolvers/timezone.rb
facter-4.0.48 lib/facter/resolvers/timezone.rb
facter-4.0.47 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.46 lib/facter/resolvers/timezone_resolver.rb