Using Object.extend for Function.protoype methods