diff options
author | Nick Schonning <nschonni@gmail.com> | 2023-02-08 04:36:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 10:36:23 +0100 |
commit | 0d1f192c54ab65a4a1c938553e5d87be65a966e8 (patch) | |
tree | 08d2241a883349ae36b3613029c88acd6b7e4434 /app/helpers/jsonld_helper.rb | |
parent | 26ac2447b4efc4689295188c5d1cd3d444f28b15 (diff) |
Apply Rubocop Performance/BlockGivenWithExplicitBlock (#23441)
* Apply Rubocop Performance/BlockGivenWithExplicitBlock * Unprefix used block parameter
Diffstat (limited to 'app/helpers/jsonld_helper.rb')
-rw-r--r-- | app/helpers/jsonld_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/jsonld_helper.rb b/app/helpers/jsonld_helper.rb index 102e4b132..e5787fd47 100644 --- a/app/helpers/jsonld_helper.rb +++ b/app/helpers/jsonld_helper.rb @@ -213,7 +213,7 @@ module JsonLdHelper end end - def load_jsonld_context(url, _options = {}, &_block) + def load_jsonld_context(url, _options = {}, &block) json = Rails.cache.fetch("jsonld:context:#{url}", expires_in: 30.days, raw: true) do request = Request.new(:get, url) request.add_headers('Accept' => 'application/ld+json') @@ -226,6 +226,6 @@ module JsonLdHelper doc = JSON::LD::API::RemoteDocument.new(json, documentUrl: url) - block_given? ? yield(doc) : doc + block ? yield(doc) : doc end end |