Class: Dsu::Presenters::EntryGroup::List::DatesPresenter
- Inherits:
-
BasePresenterEx
- Object
- BasePresenterEx
- Dsu::Presenters::EntryGroup::List::DatesPresenter
- Includes:
- Messages, NothingToList
- Defined in:
- lib/dsu/presenters/entry_group/list/dates_presenter.rb
Instance Method Summary collapse
- #display_nothing_to_list_message ⇒ Object
-
#initialize(times:, options: {}) ⇒ DatesPresenter
constructor
A new instance of DatesPresenter.
- #render ⇒ Object
Methods included from NothingToList
Constructor Details
#initialize(times:, options: {}) ⇒ DatesPresenter
Returns a new instance of DatesPresenter.
17 18 19 20 21 22 23 24 |
# File 'lib/dsu/presenters/entry_group/list/dates_presenter.rb', line 17 def initialize(times:, options: {}) raise ArgumentError, 'times must be an Array' unless times.is_a?(Array) raise ArgumentError, 'options must be a Hash' unless .is_a?(Hash) super(options: ) @times = times end |
Instance Method Details
#display_nothing_to_list_message ⇒ Object
35 36 37 38 39 |
# File 'lib/dsu/presenters/entry_group/list/dates_presenter.rb', line 35 def raise 'display_nothing_to_list_message called when there are entries to display' unless nothing_to_list? Views::EntryGroup::Shared::NoEntriesToDisplay.new(times: times, options: ).render end |
#render ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/dsu/presenters/entry_group/list/dates_presenter.rb', line 26 def render return if nothing_to_list? entry_groups.each do |entry_group| Views::EntryGroup::Show.new(entry_group: entry_group).render puts end end |