Module: Attrio::Reset::ClassMethods

Defined in:
lib/attrio/reset.rb

Instance Method Summary collapse

Instance Method Details

#define_attrio_reset(as) ⇒ Object



10
11
12
13
14
# File 'lib/attrio/reset.rb', line 10

def define_attrio_reset(as)
  define_method "reset_#{as.to_s}" do |attributes = []|
    self.send(as.to_s, attributes).values.each{ |attribute| attribute.reset! }
  end
end