12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/dsu/support/entry_group_browsable.rb', line 12
def browse_entry_groups(time:, options: {})
raise ArgumentError, 'time must be a Time object' unless time.is_a?(Time)
raise ArgumentError, 'options must be a Hash' unless options.is_a?(Hash)
options = configuration.to_h.merge(options).with_indifferent_access
times = browse_service(time: time, options: options).call
if times.empty? || (options.fetch(:include_all, false) && no_entries_for?(times: times, options: options))
display_no_entries_to_display_message time: time, options: options
return
end
output = Services::StdoutRedirectorService.call do
self.class.
= (time: time, options: options)
Views::Shared::Info.new(messages: ).render
puts
presenter = Presenters::EntryGroup::List::DatesPresenter.new(times: times, options: options)
Views::EntryGroup::List.new(presenter: presenter).render
self.class.
end
output: output, options: options
end
|