Class: Uur::ActionExecutor
- Inherits:
-
Object
- Object
- Uur::ActionExecutor
- Defined in:
- lib/uur/action_executor.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options, entries) ⇒ ActionExecutor
constructor
A new instance of ActionExecutor.
Constructor Details
#initialize(options, entries) ⇒ ActionExecutor
Returns a new instance of ActionExecutor.
4 5 6 7 |
# File 'lib/uur/action_executor.rb', line 4 def initialize(, entries) @options = @entries = entries end |
Instance Method Details
#execute ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/uur/action_executor.rb', line 9 def execute if selected_entries.none? Printers::NoEntriesMessagePrinter.new(@options[:within]).print elsif @options[:print_summary] Printers::SummaryPrinter.new(duration_formatter).print(selected_entries, @options[:summary_interval]) elsif @options[:print_list] Printers::EntriesPrinter.new(duration_formatter).print(selected_entries) end end |