Let's say I have a class, classA
, with the method functionA1
in it. I can then use this class as followed:
instance = classA()
instance.functionA1()
How would I chain methods or classes? For example:
# 1. Function A2 only available after Function A1, as it uses results from Function A1
A().F_A1().F_A2()
# 2. ClassB and it's methods only available behind Function A1
A().F_A1().B().F_B1()
# 3. ClassB and it's methods only available behind classA
A().B()
# Example:
cars().brand('Audi').color('red')
#-> return red Audi's