Dynamically create class method for Mantle parsing