Class: Rack::ContentSecurityPolicy::DirectiveVal

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/content_security_policy/contracts.rb

Class Method Summary collapse

Class Method Details

.to_sObject



21
22
23
# File 'lib/rack/content_security_policy/contracts.rb', line 21

def self.to_s
  'A CSP directive value must be a String or Boolean'
end

.valid?(val) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rack/content_security_policy/contracts.rb', line 17

def self.valid?(val)
  Contract.valid?(val, Contracts::Or[String, Contracts::Bool])
end