Class: AntiSamy::ScanResults

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_htmlObject

Returns the value of attribute clean_html.



74
75
76
# File 'lib/antisamy/scan_results.rb', line 74

def clean_html
  @clean_html
end

#messagesObject

Returns the value of attribute messages.



74
75
76
# File 'lib/antisamy/scan_results.rb', line 74

def messages
  @messages
end

#scan_endObject (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_startObject (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_timeObject

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