cartodb/lib/carto/deep_freeze.rb

8 lines
183 B
Ruby
Raw Normal View History

2020-06-15 10:58:47 +08:00
module Carto
def self.deep_freeze(obj)
obj.freeze
obj = obj.values if obj.respond_to?(:values)
obj.each { |e| Carto.deep_freeze(e) } if obj.respond_to?(:each)
end
end