It is most probably a Yucca (That is the plant name that just did not come to mind now. ) I do believe that Yucca flowers can be eaten (By humans that is and not just pets)
I am very bad at plant identification, ,..yet i find no difficulty growing any species,..i am told i have green fingers, ,..but i guess its really down to logic,..with cuttings and so forth,..like loving pets,.. i love growing things,..and can not resist when someone offers me a new plant or seeds,..i will squeeze them in someplace in the garden,..here is a shot of my second Spanish Bayonet,..still in a container. ( photo / image / picture from Philip Nulty's Garden )