Answers for "how to use getters and setters in ruby"

0

why are getters and setters important ruby

In a Ruby class we may want to expose the instance variables (the variables that are defined prefixed by @ symbol) to other classes for encapsulation. ... Getter methods are used to get the value of an instance variable while the setter methods are used to set the value of an instance variable of some class
Posted by: Guest on October-04-2021

Code answers related to "how to use getters and setters in ruby"

Browse Popular Code Answers by Language