lib/object/cache.rb in object-cache-0.0.3 vs lib/object/cache.rb in object-cache-0.0.4
- old
+ new
@@ -105,10 +105,10 @@
def build_key_prefix(key_prefix, proc)
case key_prefix
when :method_name
location = caller_locations.find { |l| "#{l.path}#{l.lineno}" == proc.source_location.join }
- location&.base_label
+ location && location.base_label
when :class_name
proc.binding.receiver.class.to_s
else
key_prefix
end