The claim of the landlord for rent and advances, or for either, may be by him assigned; and the assignee shall be invested with all the landlord's rights, and entitled to all his remedies for their enforcement.