From a51eb67742cc4aaf7ae1d51b24df3e899fe5989c Mon Sep 17 00:00:00 2001 From: Shalini Roy Date: Thu, 12 Dec 2024 05:29:23 -0800 Subject: [PATCH] Introduce inspect --- ruby.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruby.md b/ruby.md index 9cec8e3f..947f5243 100644 --- a/ruby.md +++ b/ruby.md @@ -558,6 +558,9 @@ dwight.name #=> "Dwight K. Schrute" # Calling of a class method Human.say('Hi') #=> "Hi" +# Tip: Use .inspect to see instance with instance variables +puts jim.inspect #=> # + # Variable's scopes are defined by the way we name them. # Variables that start with $ have global scope. $var = "I'm a global var"