Adding a generic method to get values from custom attributes