Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Modules Ruby Module Basics Namespaces

MICHAEL P
MICHAEL P
5,191 Points

Need Help With Ruby Code Challenge: Inside of the LaserBots module, create a class called Player.

Hi,

I need help with a Ruby Code Challenge: Module. I know how to do the first part, but I don't know how to do the 2nd part. I am stuck! I am hoping that someone can help me with this? Your help would be greatly appreciated:

Create a module called LaserBots.

module LaserBots end

The 2nd part of the challenge is what I don't know how to do:

Inside of the LaserBots module, create a class called Player.

Thank you

Sam Deighton II
Sam Deighton II
25,602 Points

You need to nest the Player class inside the module. (Replace X and Y, with LaserBots and Player below)

module X
    class Y
    end
  end

If you look at the Teachers Notes underneath the video there is a Code Sample that is a good example as well.

1 Answer

Rick Buffington
Rick Buffington
8,146 Points

Okay, this one they are being very specific - and very relaxed. Based on the challenge and previous video, they are wanting you to know how to create a Class INSIDE of a Module.

module LaserBots
  class Player   
  end
end

And that's it. Module with empty Player class created inside.