# Predefined variables and constants question

**URL:** <https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420>\
**Category:** Ruby\
**Created:** [July 22, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420 "2006-07-22T16:20:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@simonh](https://www.ruby-forum.com/u/simonh)\
**Post date:** [July 22, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420/1 "2006-07-22T16:20:39Z")

</div>

hi all. pages 333 to 337 in pickaxe2 list a whole load of global  
variables/constants, execution environment variables, standard objects  
etc.

Is it just me or does this not seem to break with the usually  
beautifully tidy, object oriented design of Ruby? I would have thought  
all such things would have been defined in a class named something like  
‘Global’

I do not mean any offence to Matz and co. and there are probably good  
reasons for things being as they are.

---

<div class="post-metadata">

**Author:** ![simonh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@simonh](https://www.ruby-forum.com/u/simonh)\
**Post date:** [July 22, 2006, 4:28pm UTC](https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420/2 "2006-07-22T16:28:01Z")

</div>

On Sat, 22 Jul 2006, Simon H. wrote:

> hi all. pages 333 to 337 in pickaxe2 list a whole load of global  
> variables/constants, execution environment variables, standard objects etc.
> 
> Is it just me or does this not seem to break with the usually beautifully  
> tidy, object oriented design of Ruby? I would have thought all such things  
> would have been defined in a class named something like ‘Global’
> 
> I do not mean any offence to Matz and co. and there are probably good  
> reasons for things being as they are.

but that woudn’t be global then would it 😉

-a

---

<div class="post-metadata">

**Author:** ![simonh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@simonh](https://www.ruby-forum.com/u/simonh)\
**Post date:** [July 22, 2006, 4:46pm UTC](https://www.ruby-forum.com/t/predefined-variables-and-constants-question/99420/3 "2006-07-22T16:46:16Z")

</div>

> but that woudn’t be global then would it 😉

Not sure I follow. Class Object is available at all times throughout a  
ruby program so is therefore global. Wouldn’t a class called Global (or  
whatever) also be? Then one could maybe do:

Global.constants

Global.variables
