Sha256: e6f6bcb76058c8aed7fe3d5e9b46e0c7d1b39906950e7e826115ff2409e263de

Contents?: true

Size: 409 Bytes

Versions: 8

Compression:

Stored size: 409 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    class Timezone < BaseResolver
      @fact_list ||= {}

      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

8 entries across 8 versions & 1 rubygems

Version Path
facter-4.0.44 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.43 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.42 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.41 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.40 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.39 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.38 lib/facter/resolvers/timezone_resolver.rb
facter-4.0.37 lib/facter/resolvers/timezone_resolver.rb