Please, take a look at PR #10848 "Allow to pass a block to `cattr_reader`."

Allow to pass a block to cattr_reader . cattr_accessor already accepts defaults using a block. So just unify the interface.

Example:

  class A
cattr_reader(:defr) { 'default_reader_value' }
end
A.defr # => 'default_reader_value'

https://github.com/rails/rails/pull/10848