Class: Report
- Inherits:
-
Object
- Object
- Report
- Defined in:
- app/reports/report.rb
Direct Known Subclasses
Defined Under Namespace
Modules: CallStatistics, ChannelRevenue Classes: AccountsPayableCommand, AccountsReceivableCommand, BaseCommand, CustomerPerformance, CustomerPerformanceCommand, 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.
4 5 6 7 8 9 |
# File 'app/reports/report.rb', line 4 def initialize() @errors = [] @results = nil @logger = .delete(:logger) || Rails.logger @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'app/reports/report.rb', line 2 def @options end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
2 3 4 |
# File 'app/reports/report.rb', line 2 def results @results end |
Class Method Details
.build(options) ⇒ Object
19 20 21 22 23 |
# File 'app/reports/report.rb', line 19 def self.build() report_class = "#{[:report_type]}_report" report_klass = report_class.classify.constantize report_klass.new() end |
.parameters ⇒ Object
15 16 17 |
# File 'app/reports/report.rb', line 15 def self.parameters {} end |
.parse_date(o) ⇒ Object
25 26 27 28 |
# File 'app/reports/report.rb', line 25 def self.parse_date(o) return o if o.is_a? Date Date.strptime(o, '%Y-%m-%d') rescue nil end |
Instance Method Details
#report_key ⇒ Object
11 12 13 |
# File 'app/reports/report.rb', line 11 def report_key self.class.to_s.tableize.singularize end |