Module: AttrMethods
- Defined in:
- lib/private_attrs/attr_methods.rb
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/private_attrs/attr_methods.rb', line 2 def self.included(base) base.class_eval do def self.private_attr_reader(*args) args.each do |arg| private attr_reader arg.to_sym public end end def self.private_attr_writer(*args) args.each do |arg| private attr_writer arg.to_sym public end end def self.private_attr_accessor(*args) args.each do |arg| private attr_accessor arg.to_sym public end end end end |