OK this ones a pretty darn hard actually*. It really depends on what you expect to get tough. See theres 2 ways (well actually 3 but i have no idea on the top of my head if way 3 would actually be worthwhile) in which you could go ahead with this. Unfortunately its almost 90% likely that you want the one that wont work out easily (that is to say its NOT hard to do its just hard to understand why it wouldn't work).
Ill explain the easy way first, but first some philosophy on how maya is assuming it is used:
Data in attributes are meant for the DG evaluation (DG = Dependency graph), DG is the part that does part of the runtime evaluation of maya. Now DG is designed to be immutable that is that during the runtime maya by design assumes that the dg does not change. Now this mean that in order for maya to be able to change shader during DG runtime then all the possible shaders you could switch to MUST be present in the graph at all times.
So to make it the way maya assumes youd just connect a bunch of shaders to a simple ramp (or 3 actually, one for color, one for alpha and one for matte opacity) and connect the output of your attribute to a multiply divide node (set divisor to the amount of options you have) and output of that to ramp v slot. Then connect the ramps to a surface shader and attach that to your surface (or you could use a layered shader). Now this will not reflect the change in your view port unfortunately, it will render out right tough.
Ok now odds are your looking into doing the same thing as in attribute editor if you change the type form the pull down. Bad news its not a attribute. To understand the difference you have to understand that maya has 2 distinctly separate work passes. Creation and runtime, they are different. All gui changes happen in creation phase, which results in runtime phase. Now the pull down just recreates the dg with a different shader. You can do the same however you have to realize that this will not work for rendering in maya vector and mentalray because they rely on teh dg to be static. Second your maya is now nolonger a simple side effect free state machine but you must manage almost every part of maya yourself after this. So not something you should embark on. Now my advice is to NOT TO EVEN try this you will not be happy. So the only reason id try this is if yoru really interested in tech behind maya. Its not that the implementation is hard, it is after all just 4 lines of code. But all teh side effects you get are going to make you lost.
There is a 3 way like i hinted its potentially elegant and has potentially problems of BOTH of theese methods.
And a 4th way is to use a scriptjob, but this requires you to make sure the attribute is nonkeyeble, and is technically misusing maya! And thats much easier to handle even in case 2. But i can not recommend methods 2-4 to anybody who cant intuitively figure out themselves, since theres a bit of other stuff thet you will need to be able to handle caused by theese that are more complex than the switch itself.
Dont do this.