...

/

Top-level Object

Top-level Object

This lesson explains the concept of "top-level object", and how it works in Ruby.

So, we’ve learned that objects come with lots of methods attached to them. And we’ve seen how we can use them to do interesting things with the object, by the way of calling these methods.

Now, if you pop into irb, or if you write the following code into an otherwise empty Ruby file, this works:

$ irb
> is_a?(Object)
true
> methods
[:to_s, :inspect, ... ]
...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy