Module: Gretel::Resettable
Instance Method Summary collapse
-
#reset! ⇒ Object
Resets all instance variables and calls
reset!
on all child modules and classes.
Instance Method Details
#reset! ⇒ Object
Resets all instance variables and calls reset!
on all child modules and classes. Used for testing.
5 6 7 8 9 10 11 |
# File 'lib/gretel/resettable.rb', line 5 def reset! instance_variables.each { |var| remove_instance_variable var } constants.each do |c| c = const_get(c) c.reset! if c.respond_to?(:reset!) end end |