Skip to content

Commit

Permalink
Fix 2.7 warning
Browse files Browse the repository at this point in the history
tried to create a Proc object without giving a block.
  • Loading branch information
utilum authored and rwz committed Oct 15, 2019
1 parent 4225dc0 commit 26a94ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/multi_json/options_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ def reset
@load_cache = {}
end

def fetch(type, key)
def fetch(type, key, &block)
cache = instance_variable_get("@#{type}_cache")
cache.key?(key) ? cache[key] : write(cache, key, &Proc.new)
cache.key?(key) ? cache[key] : write(cache, key, &block)
end

private
Expand Down

0 comments on commit 26a94ab

Please sign in to comment.