I have two methods that do the same thing in different ways.
Let’s call them method ‘a’ and method ‘b’.
I currently have two other methods ‘ma’ and ‘mb’ which are identical
except where one uses ‘a’ and the other uses ‘b’.
So instead of creating the two methods ‘ma’ and ‘mb’ which are identical
in every way except for one place in the code which does in ‘ma’ -> x.a
and in ‘mb’ -> x.b can I pass in the methods ‘a’ and ‘b’ into the code
so I don’t have to create two different versions?
In other words, is it possible to do something like this:
ma = m.method a
mb = m.method b
and them use ‘ma’ and ‘mb’ as before.