Class: DatabaseFlusher::Cleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/database_flusher/cleaner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orm) ⇒ Cleaner

Returns a new instance of Cleaner.



6
7
8
9
# File 'lib/database_flusher/cleaner.rb', line 6

def initialize(orm)
  @orm = orm
  reset_strategy
end

Instance Attribute Details

#strategyObject

Returns the value of attribute strategy.



4
5
6
# File 'lib/database_flusher/cleaner.rb', line 4

def strategy
  @strategy
end

Instance Method Details

#cleanObject



36
37
38
# File 'lib/database_flusher/cleaner.rb', line 36

def clean
  strategy.clean
end

#clean_with(name) ⇒ Object



23
24
25
26
# File 'lib/database_flusher/cleaner.rb', line 23

def clean_with(name)
  self.strategy = name
  strategy.clean_all
end

#startObject



28
29
30
# File 'lib/database_flusher/cleaner.rb', line 28

def start
  strategy.start
end

#stopObject



32
33
34
# File 'lib/database_flusher/cleaner.rb', line 32

def stop
  strategy.stop
end