Class: Report
- Inherits:
-
Object
- Object
- Report
- Defined in:
- app/reports/report.rb
Overview
Report: report.
Direct Known Subclasses
Defined Under Namespace
Modules: CallStatistics, ChannelRevenue Classes: AccountsPayableCommand, AccountsReceivableCommand, BaseCommand, CallRecordingGaps, CustomerPerformance, CustomerPerformanceCommand, DailyImportSummary, InventoryPlanningCommand, PhoneQueueReportCommand, ProjectMetric, StatusTimelineReport
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Report
constructor
A new instance of Report.
- #report_key ⇒ Object
Constructor Details
#initialize(options) ⇒ Report
Returns a new instance of Report.
6 7 8 9 10 11 |
# File 'app/reports/report.rb', line 6 def initialize() @errors = [] @results = nil @logger = .delete(:logger) || Rails.logger @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'app/reports/report.rb', line 4 def @options end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
4 5 6 |
# File 'app/reports/report.rb', line 4 def results @results end |
Class Method Details
.build(options) ⇒ Object
21 22 23 24 25 |
# File 'app/reports/report.rb', line 21 def self.build() report_class = "#{[:report_type]}_report" report_klass = report_class.classify.constantize report_klass.new() end |
.parameters ⇒ Object
17 18 19 |
# File 'app/reports/report.rb', line 17 def self.parameters {} end |
.parse_date(o) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/reports/report.rb', line 27 def self.parse_date(o) return o if o.is_a? Date begin Date.strptime(o, '%Y-%m-%d') rescue StandardError nil end end |
Instance Method Details
#report_key ⇒ Object
13 14 15 |
# File 'app/reports/report.rb', line 13 def report_key self.class.to_s.tableize.singularize end |