Class: ActionDispatch::PermissionsPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/http/permissions_policy.rb

Defined Under Namespace

Modules: Request Classes: Middleware

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ PermissionsPolicy

Returns a new instance of PermissionsPolicy.

Yields:

  • (_self)

Yield Parameters:



97
98
99
100
# File 'lib/action_dispatch/http/permissions_policy.rb', line 97

def initialize
  @directives = {}
  yield self if block_given?
end

Instance Attribute Details

#directivesObject (readonly)

Returns the value of attribute directives.



95
96
97
# File 'lib/action_dispatch/http/permissions_policy.rb', line 95

def directives
  @directives
end

Instance Method Details

#build(context = nil) ⇒ Object



116
117
118
# File 'lib/action_dispatch/http/permissions_policy.rb', line 116

def build(context = nil)
  build_directives(context).compact.join("; ")
end

#initialize_copy(other) ⇒ Object



102
103
104
# File 'lib/action_dispatch/http/permissions_policy.rb', line 102

def initialize_copy(other)
  @directives = other.directives.deep_dup
end