Ruby: Attribute Accessors

Attribute accessors in Ruby are methods that allow you to read and write instance variables of an object. They are commonly used for creating getter and setter methods for object properties. Here are some tips and tricks for using attribute accessors effectively. Leveraging attr_accessor, attr_reader, and attr_writer Ruby furnishes us with three indispensable methods for … Read more Ruby: Attribute Accessors

๐Ÿ’Ž ROR ๐Ÿš‚ :๐Ÿ—‘๏ธ Garbage collection ๐Ÿšฎ

Garbage collection (GC) is a crucial aspect of memory management in programming languages, including Ruby on Rails. The primary purpose of garbage collection in Rails is to automatically reclaim memory that is no longer in use or referenced by the program. Here are some key reasons in details, why garbage collection is essential in Rails:

Include v/s Extend

When we include a module into a particular class, the module methods are imported as instance methods. Whenever we extend a module into a class, the module methods are imported as class methods. I hope you guys enjoy and clear your concept about include and extend. If you want more helpful tips and trick just go through this link: https://jsgrip.com