• +91 9723535972
  • info@interviewmaterial.com

Ruby Interview Questions and Answers

Question - How Would You Create Getter And Setter Methods In Ruby?

Answer -

Setter and getter methods in Ruby are generated with the attr_accessor method. attr_accessor is used to generate instance variables for data that’s not stored in your database column.

You can also take the long route and create them manually.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners