Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:14:02+00:00 2026-05-26T22:14:02+00:00

I really have tried researching this problem, but I’m now getting so close to

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:14:03+00:00Added an answer on May 26, 2026 at 10:14 pm
    class Hero
      def initialize(*names)
        @names = names
      end
      def full_name
        @names.join(' ')
      end
    end
    
    def names
      heroes = [Hero.new("Christopher", "Alexander"),
                Hero.new("John", "McCarthy"),
                Hero.new("Emperor", "Joshua", "Abraham", "Norton")]
      heroes.map(&:full_name)
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be really simple, but I have tried many solutions posted on the
Everyone, I have really tried, but I can't find out how to upload photos
So I've tried to work with the pure-CSS, never-use-tables-for-layout gospel, I really have. But
I've tried researching about this for many days. I've really really no idea how
This is really starting to piss me off. I feel like I have tried
I really have not tried this, I am just curious what are the attributes
What should i use to code Classic ASP under Linux. I have really tried
I really need advice on how to do the following. I have tried several
It doesn't really have to add newlines, just something readable. Anything better than this?
so I have been researching this all morning- and I'm pretty sure the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.