I really have tried researching this problem, but I'm now getting so close to it I fear I won't find the solution without asking for help. I'm going through RubyMonk and one of the exercises has me completely stumped.
class Hero
def initialize(*names)
@names = names
end
def full_name
# a hero class allows us to easily combine an arbitrary number of names
end
end
def names
heroes = [Hero.new("Christopher", "Alexander"),
Hero.new("John", "McCarthy"),
Hero.new("Emperor", "Joshua", "Abraham", "Norton")]
# map over heroes using your new powers!
end
You can see in the comments what the code is asking for; take the names in the heroes variable and combine them into a single name. I've tried testing some puts and am unable to get anything in the STDOUT besides "#" or "nil" so clearly I am not working with it correctly.
The requirements for the goal say not to use .map or .collect but I think you actually are supposed to because it fails a requirement if you don't use .map or .collect.
Ideas?