Class: ReportAction::Report
- Inherits:
-
Object
- Object
- ReportAction::Report
- Defined in:
- lib/report_action.rb
Instance Method Summary collapse
- #build_report(process) ⇒ Object
- #has_messages?(process, group) ⇒ Boolean
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #list_report_processes ⇒ Object
- #report_item(process, group, message) ⇒ Object
- #retrieve_report_structure ⇒ Object
Constructor Details
#initialize ⇒ Report
Returns a new instance of Report.
7 8 9 |
# File 'lib/report_action.rb', line 7 def initialize @report_action = {} end |
Instance Method Details
#build_report(process) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/report_action.rb', line 25 def build_report(process) report_body = '' if @report_action.key?(process) @report_action[process].each do |group, | report_body += "<h1>#{group.capitalize}</h1>" .uniq.sort.each do || report_body += "<p>#{}</p>" end end end report_body end |
#has_messages?(process, group) ⇒ Boolean
38 39 40 41 42 |
# File 'lib/report_action.rb', line 38 def (process, group) if @report_action.key?(process) @report_action[process].key?(group) end end |
#list_report_processes ⇒ Object
17 18 19 |
# File 'lib/report_action.rb', line 17 def list_report_processes @report_action.collect { |p| p.shift } end |
#report_item(process, group, message) ⇒ Object
11 12 13 14 15 |
# File 'lib/report_action.rb', line 11 def report_item(process, group, ) @report_action[process] ||= {} @report_action[process][group] ||= [] @report_action[process][group] << end |
#retrieve_report_structure ⇒ Object
21 22 23 |
# File 'lib/report_action.rb', line 21 def retrieve_report_structure @report_action end |