Class: Dsu::Presenters::Export::DatesPresenter
- Inherits:
-
BasePresenterEx
- Object
- BasePresenterEx
- Dsu::Presenters::Export::DatesPresenter
- Defined in:
- lib/dsu/presenters/export/dates_presenter.rb
Instance Attribute Summary collapse
-
#export_file_path ⇒ Object
readonly
Returns the value of attribute export_file_path.
Instance Method Summary collapse
- #entry_group_count ⇒ Object
-
#initialize(from:, to:, options: {}) ⇒ DatesPresenter
constructor
A new instance of DatesPresenter.
- #nothing_to_export? ⇒ Boolean
- #respond(response:) ⇒ Object
Constructor Details
#initialize(from:, to:, options: {}) ⇒ DatesPresenter
Returns a new instance of DatesPresenter.
13 14 15 16 17 18 19 20 |
# File 'lib/dsu/presenters/export/dates_presenter.rb', line 13 def initialize(from:, to:, options: {}) super(options: ) @from = from @to = to self.[:times] = [from, to] end |
Instance Attribute Details
#export_file_path ⇒ Object (readonly)
Returns the value of attribute export_file_path.
11 12 13 |
# File 'lib/dsu/presenters/export/dates_presenter.rb', line 11 def export_file_path @export_file_path end |
Instance Method Details
#entry_group_count ⇒ Object
32 33 34 |
# File 'lib/dsu/presenters/export/dates_presenter.rb', line 32 def entry_group_count entry_groups&.count || 0 end |
#nothing_to_export? ⇒ Boolean
28 29 30 |
# File 'lib/dsu/presenters/export/dates_presenter.rb', line 28 def nothing_to_export? entry_groups.empty? end |
#respond(response:) ⇒ Object
22 23 24 25 26 |
# File 'lib/dsu/presenters/export/dates_presenter.rb', line 22 def respond(response:) return false unless response @export_file_path = exporter_service.call end |