Class: HTTP::Security::Headers::XXSSProtection
- Inherits:
-
Object
- Object
- HTTP::Security::Headers::XXSSProtection
- Defined in:
- lib/http/security/headers/x_xss_protection.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(directives = {}) ⇒ XXSSProtection
constructor
A new instance of XXSSProtection.
- #to_s ⇒ Object
Constructor Details
#initialize(directives = {}) ⇒ XXSSProtection
Returns a new instance of XXSSProtection.
10 11 12 13 14 |
# File 'lib/http/security/headers/x_xss_protection.rb', line 10 def initialize(directives={}) @enabled = directives[:enabled] @mode = directives[:mode] @report = directives[:report] end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
6 7 8 |
# File 'lib/http/security/headers/x_xss_protection.rb', line 6 def mode @mode end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
8 9 10 |
# File 'lib/http/security/headers/x_xss_protection.rb', line 8 def report @report end |
Instance Method Details
#enabled? ⇒ Boolean
16 17 18 |
# File 'lib/http/security/headers/x_xss_protection.rb', line 16 def enabled? !!@enabled end |
#to_s ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/http/security/headers/x_xss_protection.rb', line 20 def to_s str = if @enabled then '1' else '0' end str << "; mode=#{@mode}" if @mode str << "; report=#{@report}" if @report return str end |