lib/tzinfo/timezone.rb in tzinfo-1.2.1 vs lib/tzinfo/timezone.rb in tzinfo-1.2.2
- old
+ new
@@ -165,23 +165,23 @@
# 'Etc/GMT').
#
# Returns TimezoneProxy objects to avoid the overhead of loading Timezone
# definitions until a conversion is actually required.
def self.all_country_zones
- Country.all_codes.inject([]) {|zones,country|
+ Country.all_codes.inject([]) do |zones,country|
zones += Country.get(country).zones
- }
+ end.uniq
end
# Returns all the zone identifiers defined for all Countries. This is not the
# complete set of zone identifiers as some are not country specific (e.g.
# 'Etc/GMT'). You can obtain a Timezone instance for a given identifier
# with the get method.
def self.all_country_zone_identifiers
- Country.all_codes.inject([]) {|zones,country|
+ Country.all_codes.inject([]) do |zones,country|
zones += Country.get(country).zone_identifiers
- }
+ end.uniq
end
# Returns all US Timezone instances. A shortcut for
# TZInfo::Country.get('US').zones.
#
@@ -622,14 +622,15 @@
# identifiers.
def self.get_proxies(identifiers)
identifiers.collect {|identifier| get_proxy(identifier)}
end
- # Returns the current DataSource
+ # Returns the current DataSource.
def self.data_source
DataSource.get
end
+ # Raises an UnknownTimezone exception.
def raise_unknown_timezone
raise UnknownTimezone, 'TZInfo::Timezone constructed directly'
end
end
end