Skip to content

Commit a51eb67

Browse files
committed
Introduce inspect
1 parent 6efba34 commit a51eb67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ruby.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ dwight.name #=> "Dwight K. Schrute"
558558
# Calling of a class method
559559
Human.say('Hi') #=> "Hi"
560560

561+
# Tip: Use .inspect to see instance with instance variables
562+
puts jim.inspect #=> #<Human:0x000058b3c7f0c7a0 @name="Jim Halpert", @age=0>
563+
561564
# Variable's scopes are defined by the way we name them.
562565
# Variables that start with $ have global scope.
563566
$var = "I'm a global var"

0 commit comments

Comments
 (0)