In the method below I'm using abort
to prematurely end the action if a given condition is met.
However, abort
also throws the user out of IRB.
Is there something else besides abort the will end or break the method, but not kick the user out of irb.
Thanks.
def contrary
if @quantity.label == "particular"
abort("There is no contrary for this type of propostion. Try subcontrary")
end
quality = @quality.opposite
if @truthvalue
truthvalue = !@truthvalue
elsif !@truthvalue
truthvalue = "unknown"
end
contrary = Proposition.new(@quantity, @subject, quality, @predicate, truthvalue)
return contrary
end