Skip to content

Commit e12ff01

Browse files
committed
More rubocop fixes
1 parent bfbde8f commit e12ff01

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/uploadcare/param/authentication_header.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ def self.call(options = {})
2323
end
2424

2525
def self.validate_auth_config
26-
raise Uploadcare::Exception::AuthError, 'Public Key is blank.' if is_blank?(Uploadcare.config.public_key)
27-
raise Uploadcare::Exception::AuthError, 'Secret Key is blank.' if is_blank?(Uploadcare.config.secret_key)
26+
if empty_config_for?(Uploadcare.config.public_key)
27+
raise Uploadcare::Exception::AuthError,
28+
'Public Key is blank.'
29+
end
30+
return unless empty_config_for?(Uploadcare.config.secret_key)
31+
32+
raise Uploadcare::Exception::AuthError,
33+
'Secret Key is blank.'
2834
end
2935

30-
# rubocop:disable Naming/PredicateName
31-
def self.is_blank?(value)
36+
def self.empty_config_for?(value)
3237
value.nil? || value.empty?
3338
end
34-
# rubocop:enable Naming/PredicateName
3539
end
3640
end
3741
end

0 commit comments

Comments
 (0)