Sha256: b3fb0f989f478eb6b33a90bcec2a2239eb67e8b2ef2b6ce78774aed2266dee44

Contents?: true

Size: 1.6 KB

Versions: 77

Compression:

Stored size: 1.6 KB

Contents

module TZInfo
  # The timezone index file includes TimezoneIndexDefinition which provides
  # methods used to define timezones in the index.
  #
  # @private
  module TimezoneIndexDefinition #:nodoc:
    # Add class methods to the includee and initialize class instance variables.
    def self.append_features(base)
      super
      base.extend(ClassMethods)
      base.instance_eval do
        @timezones = []
        @data_timezones = []
        @linked_timezones = []
      end
    end
    
    # Class methods for inclusion.
    #
    # @private
    module ClassMethods #:nodoc:
      # Defines a timezone based on data.
      def timezone(identifier)
        @timezones << identifier
        @data_timezones << identifier
      end
      
      # Defines a timezone which is a link to another timezone.
      def linked_timezone(identifier)
        @timezones << identifier
        @linked_timezones << identifier
      end
      
      # Returns a frozen array containing the identifiers of all the timezones.
      # Identifiers appear in the order they were defined in the index.
      def timezones
        @timezones.freeze
      end
      
      # Returns a frozen array containing the identifiers of all data timezones.
      # Identifiers appear in the order they were defined in the index.
      def data_timezones
        @data_timezones.freeze
      end
      
      # Returns a frozen array containing the identifiers of all linked
      # timezones. Identifiers appear in the order they were defined in 
      # the index.
      def linked_timezones
        @linked_timezones.freeze
      end      
    end
  end
end

Version data entries

77 entries across 73 versions & 27 rubygems

Version Path
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
spiral_form-0.1.1 vendor/bundle/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
spiral_form-0.1.0 vendor/bundle/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
nullifyable-0.1.0 vendor/bundle/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
tdiary-5.0.8 vendor/bundle/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
tzinfo-1.2.5 lib/tzinfo/timezone_index_definition.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/tzinfo-1.2.3/lib/tzinfo/timezone_index_definition.rb
tzinfo-1.2.4 lib/tzinfo/timezone_index_definition.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/tzinfo-1.2.2/lib/tzinfo/timezone_index_definition.rb