@yegor256 Can you please add some explanation comments to method paid in class Tax
because now it's difficult to figure out how this method return a value
def paid
txns = @wallet.txns
scored = txns.map do |t|
pfx, body = t.details.split(' ', 2)
next if pfx != PREFIX || body.nil?
score = Score.parse(body)
next if !score.valid? || score.value != EXACT_SCORE
if score.strength < @strength && !@ignore_score_weakness
next unless MILESTONES.find { |d, s| t.date < d && score.strength >= s }
end
next if t.amount > MAX_PAYMENT
t
end.compact.uniq(&:details)
scored.empty? ? Amount::ZERO : scored.map(&:amount).inject(&:+) * -1
end
@strogiyotec/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!
@yegor256 Can you please add some explanation comments to method
paid
inclass Tax
because now it's difficult to figure out how this method return a value