Export values to a user specified format

Hello, I have this task assigned to me currently :

Part 1: Create a console based application that accepts patient
details(Name, Age and Sex) and then exports those details into one of 2
formats, depending on the user’s choice - “plain text” or “pdf”

Part 2: Extend the above program to allow for a 3rd format called
“foobar” that can be plugged in. The details of this format will not
however be revealed. Therefore you’ll need to provide a way for your
customer to add the new format - without having to touch your existing
code. The application, when re-started, should then allow the user to
choose that format as the 3rd option.

I’m fine with the first part as it involves simple File operations,and I
can use a rubyGem like Prawn to help out, but I’m having trouble with
the 2nd portion. Could someone please explain/help out on how this would
be done?

Any help with this would be greatly appreciated.