Do you know what year it is?
28 karma · joined May 16, 2015
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.No, it can't. If this is something you've seen "many times", would you mind providing an example? Show me a program that Ruby tries to execute without having been able to parse it.