Sha256: 33a1e4de716ad053580931139c30cd383b27690a6cd1df4b82b62b907152a769

Contents?: true

Size: 615 Bytes

Versions: 5

Compression:

Stored size: 615 Bytes

Contents

require 'time_crisis/tzinfo/timezone'

module TimeCrisis
  module TZInfo

    # A Timezone based on a TimezoneInfo.
    class InfoTimezone < Timezone #:nodoc:

      # Constructs a new InfoTimezone with a TimezoneInfo instance.
      def self.new(info)
        tz = super()
        tz.send(:setup, info)
        tz
      end

      # The identifier of the timezone, e.g. "Europe/Paris".
      def identifier
        @info.identifier
      end

      protected
      # The TimezoneInfo for this Timezone.
      def info
        @info
      end

      def setup(info)
        @info = info
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
time_crisis-0.3.5 lib/time_crisis/tzinfo/info_timezone.rb
time_crisis-0.3.2 lib/time_crisis/tzinfo/info_timezone.rb
time_crisis-0.3.1 lib/time_crisis/tzinfo/info_timezone.rb
time_crisis-0.3.0 lib/time_crisis/tzinfo/info_timezone.rb
time_crisis-0.2.0 lib/time_crisis/tzinfo/info_timezone.rb