module Gretel::Resettable

Public Instance Methods

reset!() click to toggle source

Resets all instance variables and calls reset! on all child modules and classes. Used for testing.

# 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