Class: TruncationBase
- Inherits:
-
Object
- Object
- TruncationBase
- Defined in:
- lib/database_cleaner/truncation_base.rb
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(options = {}) ⇒ TruncationBase
constructor
A new instance of TruncationBase.
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ TruncationBase
Returns a new instance of TruncationBase.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/database_cleaner/truncation_base.rb', line 3 def initialize( = {}) if !.empty? && !(.keys - [:only, :except]).empty? raise ArgumentError, "The only valid options are :only and :except. You specified #{options.keys.join(',')}." end if .has_key?(:only) && .has_key?(:except) raise ArgumentError, "You may only specify either :only or :either. Doing both doesn't really make sense does it?" end @only = [:only] @tables_to_exclude = ([:except] || []) if migration_storage = migration_storage_name @tables_to_exclude << migration_storage end end |
Instance Method Details
#clean ⇒ Object
22 23 24 |
# File 'lib/database_cleaner/truncation_base.rb', line 22 def clean raise NotImplementedError end |
#start ⇒ Object
18 19 20 |
# File 'lib/database_cleaner/truncation_base.rb', line 18 def start # no-op end |