Class: ActionDispatch::FeaturePolicy
- Defined in:
- actionpack/lib/action_dispatch/http/feature_policy.rb
Defined Under Namespace
Modules: Request Classes: Middleware
Instance Attribute Summary collapse
-
#directives ⇒ Object
readonly
Returns the value of attribute directives.
Instance Method Summary collapse
- #build(context = nil) ⇒ Object
-
#initialize {|_self| ... } ⇒ FeaturePolicy
constructor
A new instance of FeaturePolicy.
- #initialize_copy(other) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ FeaturePolicy
Returns a new instance of FeaturePolicy.
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
#directives ⇒ Object (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 |