Class: Rack::ContentSecurityPolicy::Directives

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

Class Method Summary collapse

Class Method Details

.to_sObject



31
32
33
# File 'lib/rack/content_security_policy/contracts.rb', line 31

def self.to_s
  'A CSP directive key/value Hash'
end

.valid?(val) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/rack/content_security_policy/contracts.rb', line 27

def self.valid?(val)
  Contract.valid?(val, Contracts::HashOf[DirectiveKey => DirectiveVal])
end