The variable value will hold the object for which the switch is made. The variable satisfied tells us, if any of the case conditions are met. The variable response will hold the result of the operation, which will be made in case of fulfillment of the conditions of any case.

Next we define a class method for: which creates an instance of the class Switch.

Switch>>for: anObject
^self new value: anObject

To avoid having to initialize the variable satisfied to false, we define a method isSatisfied, which returns true only if the variable satisfied is true.