Last active
June 30, 2021 03:16
-
-
Save JuzerShakir/064c5f1b253151cad10df3d5041f3431 to your computer and use it in GitHub Desktop.
Getting instance variables, for variable doc in medium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# accessing through instance of a class | |
object.instance_variables # => @var | |
# accessing through class after initilize | |
Inst_var.new.instance_variables # => @var | |
# accessing directly through class | |
Inst_var.instance_variables # => NoMethodError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment