Define and access a class method