The European Parliament has ratified the Paris Agreement on climate change, in a move that clears the last hurdle for the pact to enter into force.