Class: AntiSamy::ScanResults
- Inherits:
-
Object
- Object
- AntiSamy::ScanResults
- Defined in:
- lib/antisamy/scan_results.rb
Overview
Container of scan results, provides a list of ScanMessage indicating why elements were removed from the resulting html
Instance Attribute Summary collapse
-
#clean_html ⇒ Object
Returns the value of attribute clean_html.
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#scan_end ⇒ Object
readonly
Returns the value of attribute scan_end.
-
#scan_start ⇒ Object
readonly
Returns the value of attribute scan_start.
Instance Method Summary collapse
-
#initialize(scan_start, scan_end = nil) ⇒ ScanResults
constructor
A new instance of ScanResults.
-
#scan_time ⇒ Object
Get the calculated scan time.
Constructor Details
#initialize(scan_start, scan_end = nil) ⇒ ScanResults
Returns a new instance of ScanResults.
75 76 77 78 79 80 |
# File 'lib/antisamy/scan_results.rb', line 75 def initialize(scan_start,scan_end = nil) @errors = [] @scan_start = scan_start @scan_end = scan_end @clean_html = '' end |
Instance Attribute Details
#clean_html ⇒ Object
Returns the value of attribute clean_html.
74 75 76 |
# File 'lib/antisamy/scan_results.rb', line 74 def clean_html @clean_html end |
#messages ⇒ Object
Returns the value of attribute messages.
74 75 76 |
# File 'lib/antisamy/scan_results.rb', line 74 def @messages end |
#scan_end ⇒ Object (readonly)
Returns the value of attribute scan_end.
73 74 75 |
# File 'lib/antisamy/scan_results.rb', line 73 def scan_end @scan_end end |
#scan_start ⇒ Object (readonly)
Returns the value of attribute scan_start.
73 74 75 |
# File 'lib/antisamy/scan_results.rb', line 73 def scan_start @scan_start end |
Instance Method Details
#scan_time ⇒ Object
Get the calculated scan time
83 84 85 86 |
# File 'lib/antisamy/scan_results.rb', line 83 def scan_time @scan_end ||= Time.now (@scan_end - @scan_start).round(2) end |