Class: HTTP::Security::Headers::XPermittedCrossDomainPolicies
- Inherits:
-
Object
- Object
- HTTP::Security::Headers::XPermittedCrossDomainPolicies
- Defined in:
- lib/http/security/headers/x_permitted_cross_domain_policies.rb
Instance Method Summary collapse
- #all? ⇒ Boolean
- #by_content_type? ⇒ Boolean
- #by_ftp_filename? ⇒ Boolean
-
#initialize(directives = {}) ⇒ XPermittedCrossDomainPolicies
constructor
A new instance of XPermittedCrossDomainPolicies.
- #master_only? ⇒ Boolean
- #none? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(directives = {}) ⇒ XPermittedCrossDomainPolicies
Returns a new instance of XPermittedCrossDomainPolicies.
6 7 8 9 10 11 12 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 6 def initialize(directives={}) @none = directives[:none] @master_only = directives[:master_only] @by_content_type = directives[:by_content_type] @by_ftp_filename = directives[:by_ftp_filename] @all = directives[:all] end |
Instance Method Details
#all? ⇒ Boolean
30 31 32 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 30 def all? !!@all end |
#by_content_type? ⇒ Boolean
22 23 24 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 22 def by_content_type? !!@by_content_type end |
#by_ftp_filename? ⇒ Boolean
26 27 28 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 26 def by_ftp_filename? !!@by_ftp_filename end |
#master_only? ⇒ Boolean
18 19 20 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 18 def master_only? !!@master_only end |
#none? ⇒ Boolean
14 15 16 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 14 def none? !!@none end |
#to_s ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/http/security/headers/x_permitted_cross_domain_policies.rb', line 34 def to_s if @none then 'none' elsif @master_only then 'master-only' elsif @by_content_type then 'by-content-type' elsif @by_ftp_filename then 'by-ftp-filename' elsif @all then 'all' else '' end end |