Browse files

make zones_map private

  • Loading branch information...
1 parent 409fbff commit 184e4de8010cfc84866bb5057803f4d02d375a60 @mcfiredrill committed Mar 3, 2014
Showing with 9 additions and 9 deletions.
  1. +8 −7 activesupport/lib/active_support/values/time_zone.rb
  2. +1 −2 activesupport/test/time_zone_test.rb
View
15 activesupport/lib/active_support/values/time_zone.rb
@@ -377,13 +377,6 @@ def all
@zones ||= zones_map.values.sort
end
- def zones_map
- @zones_map ||= begin
- MAPPING.each_key {|place| self[place]} # load all the zones
- @lazy_zones_map
- end
- end
-
# Locate a specific time zone object. If the argument is a string, it
# is interpreted to mean the name of the timezone to locate. If it is a
# numeric value it is either the hour offset, or the second offset, of the
@@ -410,6 +403,14 @@ def [](arg)
def us_zones
@us_zones ||= all.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }
end
+
+ private
+ def zones_map
+ @zones_map ||= begin
+ MAPPING.each_key {|place| self[place]} # load all the zones
+ @lazy_zones_map
+ end
+ end
end
private
View
3 activesupport/test/time_zone_test.rb
@@ -395,8 +395,7 @@ def test_unknown_zone_with_utc_offset
end
def test_unknown_zones_dont_store_mapping_keys
- ActiveSupport::TimeZone["bogus"]
- assert !ActiveSupport::TimeZone.zones_map.key?("bogus")
+ assert_nil ActiveSupport::TimeZone["bogus"]
end
def test_new

0 comments on commit 184e4de

Please sign in to comment.