Skip to content

Instantly share code, notes, and snippets.

Avatar

David Bastidas animationdavid

View GitHub Profile
View switcher.py
class Switcher(object):
def numbers_of_options(self, argument):
"""Dispatch method"""
method_name = 'option_' + str(argument)
method = getattr(self, method_name, lambda: "Invalid option")
return method()
def option_1(self):
return "My option 1"