# Shell.rb and class \<\< Shell

**URL:** <https://www.ruby-forum.com/t/shell-rb-and-class-shell/57695>\
**Category:** Ruby\
**Created:** [April 13, 2006, 3:24am UTC](https://www.ruby-forum.com/t/shell-rb-and-class-shell/57695 "2006-04-13T03:24:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amin1426](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Post date:** [April 13, 2006, 3:24am UTC](https://www.ruby-forum.com/t/shell-rb-and-class-shell/57695/1 "2006-04-13T03:24:54Z")

</div>

I’m confuzzled.

In lib/shell.rb I read…

============================================================  
class Shell  
@RCS\_ID=’-$Id: shell.rb,v 1.8 2001/03/19 09:01:11 keiju Exp keiju $-’

include Error  
extend Exception2MessageMapper

# @cascade = true

# debug: true -\> normal debug

# debug: 1 -\> eval definition debug

# debug: 2 -\> detail inspect debug

@debug = false  
@verbose = true

# class \<\< Shell

Question 1.  
Why does he use this “class \<\< Shell” trick? What does that do?

Question 2.  
What does Exception2MessageMapper do? Yes, I have read the comments  
three times, and I still don’t know what it does or why.

John C. Phone : (64)(3) 358 6639  
Tait Electronics Fax : (64)(3) 359 4632  
PO Box 1645 Christchurch Email : removed\_email\_address@domain.invalid  
New Zealand

Carter’s Clarification of Murphy’s Law.

“Things only ever go right so that they may go more spectacularly wrong  
later.”

From this principle, all of life and physics may be deduced.

---

<div class="post-metadata">

**Author:** ![amin1426](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4da419/32.png) [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Post date:** [April 13, 2006, 4:10am UTC](https://www.ruby-forum.com/t/shell-rb-and-class-shell/57695/2 "2006-04-13T04:10:14Z")

</div>

On 4/12/06, John C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Question 1.  
> Why does he use this “class \<\< Shell” trick? What does that do?

This is equivalent to:

class Shell  
class \<\< self  
end  
end

The latter you should be familiar with from numerous postings on the  
list.

> Question 2.  
> What does Exception2MessageMapper do? Yes, I have read the comments  
> three times, and I still don’t know what it does or why.

You’ll need to look at lib/e2mm.rb for details, but it seems to create  
a framework for exceptions with default error messages.

-austin
