Sha256: 0cd1c81f4b3a1daac5c46a83c685e266e452be7fd7d0d1c117067284afc3cd82

Contents?: true

Size: 920 Bytes

Versions: 1

Compression:

Stored size: 920 Bytes

Contents

# To change this template, choose Tools | Templates
# and open the template in the editor.

module SDL4R
  class AbbreviationTimezoneProxy < TZInfo::Timezone

    def self.new(identifier, consider_modern_abbreviations)
      o = super()
      o._initialize(identifier, consider_modern_abbreviations)
      o
    end

    def _initialize(identifier, consider_modern_abbreviations)
      @identifier = identifier
      @consider_modern_abbreviations = consider_modern_abbreviations
      @actual_timezone = nil
    end

    def actual_timezone
      unless @actual_timezone
        @actual_timezone = get_timezone(identifier, consider_modern_abbreviations)
      end
      @actual_timezone
    end

    def identifier
      @identifier
    end

    def period_for_utc(utc)
      actual_timezone.period_for_utc(utc)
    end

    def periods_for_local(local)
      actual_timezone.periods_for_local(local)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sdl4r-0.9.11 lib/sdl4r/abbreviation_timezone_proxy.rb