Reputation: 185
I'd like to DRY up my methods. I have several (legacy) methods with the same name except for a variable at the end. These methodes all do the same thing. These method names are used in publicly distributed URL's so renaming them is not an option. I'm looking for a way to use a flexibel method name or catch all method based on the begin of the method name. I read articles about calling method names with variables in them but that is not what I'm looking for here (I think). I'd like to do something like
def holiday_"#{var}"
code
end
Any suggestions?
Regards,
Rutger
Upvotes: 0
Views: 336