Consider this code:
class Bar
def initialize
puts 'Hi from class Bar.'
exit
end
end
class Foo
def initialize
loop {
case $stdin.gets.chomp
when 'foo'
puts 'Hi from class Foo.'
when 'bar'
Bar.new
end
}
end
end
Can I ignore the exit in class Bar somehow?
It terminates my loop. I don't want that.
Note - the real code base is much larger and more complicated than that. But it boils down to this question whether I can ignore exit() or not.