Fail
def is_odd?(num)
num.odd?
rescue
fail StandardError, 'you cannot use odd on this'
end
> is_odd?(1)
#=> true
> is_odd?('hello')
#=> StandardError: you cannot use odd on thisLast updated
def is_odd?(num)
num.odd?
rescue
fail StandardError, 'you cannot use odd on this'
end
> is_odd?(1)
#=> true
> is_odd?('hello')
#=> StandardError: you cannot use odd on thisLast updated