Class: TrueandcoAnalytics::Reports
- Inherits:
-
Object
- Object
- TrueandcoAnalytics::Reports
show all
- Extended by:
- Modules::Info
- Defined in:
- lib/trueandco_analytics/common/services/reports.rb
Class Method Summary
collapse
error_message, info, result
Class Method Details
.available_reports ⇒ Object
.get_report_obj(report_name, format = nil, datetime_start = nil, datetime_end = nil) ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/trueandco_analytics/common/services/reports.rb', line 14
def self.get_report_obj(report_name, format = nil, datetime_start = nil, datetime_end = nil)
unless self.available_reports.include? report_name
raise ArgumentError, I18n.t("trueandco_analytics.error.argument.unknown_report")
end
Object.const_get("TrueandcoAnalytics::#{report_name.camelize}").new(format, datetime_start, datetime_end)
rescue ArgumentError => e
error_message(e.message)
rescue StandardError => e
error_message(e.message)
end
|