Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

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
 
PREVIOUS NEXT
Tagged: #getters #setters #important #ruby
ADD COMMENT
Topic
Name
6+5 =