I have a following array
Bot = Struct.new(:name, :age)
bots = %w(foo bar baz).map do |name|
Bot.new(name, rand(10))
end
p bots
[ #<struct Bot name="foo", age=3>,
#<struct Bot name="bar", age=8>,
#<struct Bot name="baz", age=0> ]
I want to get a new array from bots, where age attribute converted to_s, but I don't want to change the real objects in the array bots.
How can I do this?