Class: Dsu::Presenters::Import::DatesPresenter

Inherits:
BasePresenterEx show all
Includes:
ImportEntry, ImportFile
Defined in:
lib/dsu/presenters/import/dates_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ImportFile

#import_entry_groups_count, #import_file_path_exist?, #nothing_to_import?

Methods included from ImportEntry

#overriding_project?

Constructor Details

#initialize(from:, to:, import_file_path:, options: {}) ⇒ DatesPresenter

Returns a new instance of DatesPresenter.



18
19
20
21
22
23
24
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 18

def initialize(from:, to:, import_file_path:, options: {})
  super(options: options)

  @from = from.beginning_of_day
  @to = to.end_of_day
  @import_file_path = import_file_path
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



16
17
18
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 16

def from
  @from
end

#import_file_pathObject (readonly)

Returns the value of attribute import_file_path.



16
17
18
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 16

def import_file_path
  @import_file_path
end

#import_messagesObject (readonly)

Returns the value of attribute import_messages.



16
17
18
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 16

def import_messages
  @import_messages
end

#toObject (readonly)

Returns the value of attribute to.



16
17
18
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 16

def to
  @to
end

Instance Method Details

#project_nameObject



30
31
32
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 30

def project_name
  @project_name ||= Models::Project.current_project.project_name
end

#respondObject



26
27
28
# File 'lib/dsu/presenters/import/dates_presenter.rb', line 26

def respond
  @import_messages = importer_service.call
end