Class: ActionDispatch::FeaturePolicy

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

Defined Under Namespace

Modules: Request Classes: Middleware

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of FeaturePolicy.

Yields:

  • (_self)

Yield Parameters:



92
93
94
95
# File 'actionpack/lib/action_dispatch/http/feature_policy.rb', line 92

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

Instance Attribute Details

#directivesObject (readonly)

Returns the value of attribute directives



90
91
92
# File 'actionpack/lib/action_dispatch/http/feature_policy.rb', line 90

def directives
  @directives
end

Instance Method Details

#build(context = nil) ⇒ Object



111
112
113
# File 'actionpack/lib/action_dispatch/http/feature_policy.rb', line 111

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

#initialize_copy(other) ⇒ Object



97
98
99
# File 'actionpack/lib/action_dispatch/http/feature_policy.rb', line 97

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