Class: Timet::ApplicationHelper::ReportExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/timet/application_helper.rb

Overview

Note:

This class is responsible for exporting reports to CSV and iCalendar formats.

Class Method Summary collapse

Class Method Details

.export_csv_report(report, options) ⇒ void

This method returns an undefined value.

Exports the report to a CSV file if the ‘csv` option is provided.

Parameters:

  • report (TimeReport)

    The report object to export.

  • options (Hash)

    The options hash containing export settings.

Options Hash (options):

  • :csv (String)

    The filename to use when exporting the report to CSV.



217
218
219
# File 'lib/timet/application_helper.rb', line 217

def self.export_csv_report(report, options)
  report.export_csv if options[:csv]
end

.export_icalendar_report(report, options) ⇒ void

This method returns an undefined value.

Exports the report to an iCalendar file if the ‘ics` option is provided.

Parameters:

  • report (TimeReport)

    The report object to export.

  • options (Hash)

    The options hash containing export settings.

Options Hash (options):

  • :ics (String)

    The filename to use when exporting the report to iCalendar.



227
228
229
# File 'lib/timet/application_helper.rb', line 227

def self.export_icalendar_report(report, options)
  report.export_icalendar if options[:ics]
end