Class: Cleaner::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rules) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
# File 'lib/cleaner/runner.rb', line 5

def initialize(rules)
  @rules = rules
  @directories = []
end

Instance Attribute Details

#directoriesObject (readonly)

Returns the value of attribute directories.



3
4
5
# File 'lib/cleaner/runner.rb', line 3

def directories
  @directories
end

#rulesObject (readonly)

Returns the value of attribute rules.



3
4
5
# File 'lib/cleaner/runner.rb', line 3

def rules
  @rules
end

Instance Method Details

#startObject



10
11
12
13
# File 'lib/cleaner/runner.rb', line 10

def start
  instance_eval(rules)
  directories.each(&:clean)
end