Middle three digits: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Use appropriate error class.)
m (→‎{{header|Ruby}}: Correct mang tag.)
Line 548: Line 548:


=={{header|Ruby}}==
=={{header|Ruby}}==
<lang>def middle_three_digits(n)
<lang ruby>def middle_three_digits(n)
# minus sign doesn't factor into digit count,
# minus sign doesn't factor into digit count,
# and calling #abs acts as a duck-type assertion
# and calling #abs acts as a duck-type assertion