adHawk/hanami-events-cloud_pubsub

View on GitHub
lib/hanami/events/cloud_pubsub/middleware/client/request_id.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use attributes[:request_id] = ::RequestId.request_id || SecureRandom.uuid instead of attributes.merge!( request_id: ::RequestId.request_id || SecureRandom.uuid ).
Open

              attributes.merge!(
                request_id: ::RequestId.request_id || SecureRandom.uuid
              )

This cop identifies places where Hash#merge! can be replaced by Hash#[]=.

Example:

hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash.merge!(a: 1, b: 2)

There are no issues that match your filters.

Category
Status