Is it possible to make this code more compact? Am I missing anything here?
if value < min_rate
min_rate
elsif value > max_rate
max_rate
else
value
end
Here's something completely different:
[min_rate, value, max_rate].sort[1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With