Module: AttrBoolean::ClassMethods
- Defined in:
- lib/attr_boolean.rb
Instance Method Summary collapse
Instance Method Details
#attr_boolean(*args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/attr_boolean.rb', line 16 def attr_boolean(*args) = args. raise ArgumentError, "cannot specify options if defining multiple boolean attributes in one call" if args.size > 1 and !.empty? args.each do |boolean| boolean = boolean.intern self.class_eval { attr_accessor boolean } self.define_methods(boolean, ) end end |