Understading why attr_accessor in Ruby is faster than a regular method
17-Jun-2022 902
Setters and getters (or accessors) are very common in various object–oriented programming languages. Some languages have shortcuts to define them, others require programmers to write them by hand (hi, Java!). Ruby does have these shortcuts: attr_reader generates getters, attr_writer generates setter, and, finally, attr_accessor generates both:.
Understading why attr_accessor in Ruby is faster than a regular method #ruby #rubydeveloper #rubyonrails #Understading #attr_accessor #faster #regular #method https://rubyonrails.ba/link/understading-why-attr_accessor-in-ruby-is-faster-than-a-regular-method