Sha256: 3bb495bf453ac01225e4431f8ac22fb6fcf3436c05d1d2b7dadf758dc9051294

Contents?: true

Size: 1.41 KB

Versions: 46

Compression:

Stored size: 1.41 KB

Contents

# encoding: UTF-8
# frozen_string_literal: true

module TZInfo
  module DataSources
    # Represents a time zone defined by a data source.
    #
    # @abstract Data sources return instances of {TimezoneInfo} subclasses.
    class TimezoneInfo
      # @return [String] the identifier of the time zone.
      attr_reader :identifier

      # Initializes a new TimezoneInfo. The passed in `identifier` instance will
      # be frozen.
      #
      # @param identifier [String] the identifier of the time zone.
      # @raise [ArgumentError] if `identifier` is `nil`.
      def initialize(identifier)
        raise ArgumentError, 'identifier must be specified' unless identifier
        @identifier = identifier.freeze
      end

      # @return [String] the internal object state as a programmer-readable
      #   `String`.
      def inspect
        "#<#{self.class}: #@identifier>"
      end

      # @return [Timezone] a new {Timezone} instance for the time zone
      #   represented by this {TimezoneInfo}.
      def create_timezone
        raise_not_implemented('create_timezone')
      end

      private

      # Raises a {NotImplementedError}.
      #
      # @param method_name [String] the name of the method that must be
      #   overridden.
      # @raise NotImplementedError always.
      def raise_not_implemented(method_name)
        raise NotImplementedError, "Subclasses must override #{method_name}"
      end
    end
  end
end

Version data entries

46 entries across 41 versions & 22 rubygems

Version Path
tailscale_middleware-0.0.3 vendor/cache/ruby/3.4.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.5/lib/tzinfo/data_sources/timezone_info.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/data_sources/timezone_info.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/timezone_info.rb