I'm not familiar with this library (I only scanned the README) but I think you might be interested in the fact, that as of Ruby 3.0, it supports chaining private call with methods that defines attribute accessors (I implemented this, see https://bugs.ruby-lang.org/issues/17314). Having this feature, it is unnecessary to have method like attr_private and I think it would be good idea to mention that in the README file.
Here is example usage.
class Foo
private attr_accessor :foo, :bar
# this the same as:
attr_accessor :foo, :bar
private :foo, :foo=, :bar, :bar=
end
This works with any method which returns defined method name (symbol) or defined method names (array of symbols). As of Ruby 3.0 attr_{reader,writer,accessor} returns array of defined method names:
class Foo
p attr_accessor :foo, :bar #=> [:foo, :foo=, :bar, :bar=]
end
Hello.
I'm not familiar with this library (I only scanned the README) but I think you might be interested in the fact, that as of Ruby 3.0, it supports chaining
private
call with methods that defines attribute accessors (I implemented this, see https://bugs.ruby-lang.org/issues/17314). Having this feature, it is unnecessary to have method likeattr_private
and I think it would be good idea to mention that in the README file.Here is example usage.
This works with any method which returns defined method name (symbol) or defined method names (array of symbols). As of Ruby 3.0
attr_{reader,writer,accessor}
returns array of defined method names: