Skip to content

Commit

Permalink
Address rubocop failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ugexe committed Jun 12, 2024
1 parent 3865187 commit b611cf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/minfraud/components/report/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ def validate
validate_uuid('minfraud_id', @minfraud_id)

if ip_address.nil? &&
(minfraud_id.nil? || is_empty_uuid(minfraud_id)) &&
(minfraud_id.nil? || empty_uuid(minfraud_id)) &&
(maxmind_id.nil? || maxmind_id.empty?) &&
(transaction_id.nil? || transaction_id.empty?)
raise ArgumentError, 'At least one of the following is required: ip_address, minfraud_id, maxmind_id, transaction_id.'
end
end

def is_empty_uuid(value)
def empty_uuid(value)
stripped_value = value.to_s.gsub('-', '')
return stripped_value == '0' * 32
stripped_value == '0' * 32
end
end
end
Expand Down

0 comments on commit b611cf6

Please sign in to comment.