/usr/lib/ruby/vendor_ruby/tzinfo/timezone_index_definition.rb is in ruby-tzinfo 1.2.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 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
|