Key Concepts

Review core concepts you need to learn to master this subject

Ruby namespace

#To retrieve a constant from the Math module, the scope resolution operator (::), should be used. puts Math::PI # => 3.141592653589793 #In this example, Ruby is targetting the PI constant from the Math module using the scope resolution operator, (::), and printing its value to the console.

In Ruby, the term namespace refers to a module the contains a group of related objects. An example of a Ruby namespace is the Math module.

Object-Oriented Programming II
Lesson 1 of 2