Person = Struct.new :name, :age
people = [
Person.new('Alice', 42),
Person.new('Bob', 23),
Person.new('Carol', 30)
]
people.sort_by(&:age).map(&:name)
# => ["Bob", "Carol", "Alice"] $ whatis code
code: nothing appropriate.