Class: CleanFiles::Runner
- Inherits:
-
Object
- Object
- CleanFiles::Runner
- Defined in:
- lib/clean_files/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments) ⇒ Runner
constructor
A new instance of Runner.
-
#run ⇒ Object
Parse options, check arguments, then process the command.
Constructor Details
#initialize(arguments) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 15 16 17 |
# File 'lib/clean_files/runner.rb', line 11 def initialize(arguments) @arguments = arguments # Set defaults = Hash.new [:threshold] = 1.month.ago end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/clean_files/runner.rb', line 9 def end |
Instance Method Details
#run ⇒ Object
Parse options, check arguments, then process the command
20 21 22 23 24 25 26 27 28 |
# File 'lib/clean_files/runner.rb', line 20 def run if && arguments_valid? Cleaner.new(.delete(:paths), ).start else output_usage end end |