Ruby - Enumerable and Collection Processing
Given an array of hashes representing products:
products = [
{name: "Pen", price: 1.5, stock: 10},
{name: "Notebook", price: 2.0, stock: 0},
{name: "Eraser", price: 0.5, stock: 5}
]
How would you use sort_by to get products sorted by price but only include those with stock greater than zero?