This is known as the strategy pattern:
http://en.wikipedia.org/wiki/Strategy_pattern

Googling around for 'ruby strategy pattern' turns up some interesting
things, like this: http://tangleofwire.net/the-strategy-pattern-in-ruby