Class: Cerbos::Input::ResourceQuery
- Inherits:
-
Object
- Object
- Cerbos::Input::ResourceQuery
- Defined in:
- lib/cerbos/input/resource_query.rb
Overview
Partial details of resources to be queried.
Instance Attribute Summary collapse
-
#attr ⇒ Attributes
readonly
Any application-specific attributes describing the resources to be queried that are known in advance.
-
#kind ⇒ String
readonly
The type of resources to be queried.
-
#policy_version ⇒ String?
readonly
The policy version to use when planning the query.
-
#scope ⇒ String?
readonly
The policy scope to use when planning the query.
Instance Method Summary collapse
-
#attributes ⇒ Attributes
deprecated
Deprecated.
Use #attr instead.
-
#initialize(kind:, attr: {}, attributes: nil, policy_version: nil, scope: nil) ⇒ ResourceQuery
constructor
Specify partial details of resources to be queried.
Constructor Details
#initialize(kind:, attr: {}, attributes: nil, policy_version: nil, scope: nil) ⇒ ResourceQuery
Specify partial details of resources to be queried.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/cerbos/input/resource_query.rb', line 38 def initialize(kind:, attr: {}, attributes: nil, policy_version: nil, scope: nil) unless attributes.nil? Cerbos.deprecation_warning "The `attributes` keyword argument is deprecated. Use `attr` instead." attr = attributes end @kind = kind @attr = Input.coerce_required(attr, Attributes) @policy_version = policy_version @scope = scope end |
Instance Attribute Details
#attr ⇒ Attributes (readonly)
Any application-specific attributes describing the resources to be queried that are known in advance.
15 16 17 |
# File 'lib/cerbos/input/resource_query.rb', line 15 def attr @attr end |
#kind ⇒ String (readonly)
The type of resources to be queried.
10 11 12 |
# File 'lib/cerbos/input/resource_query.rb', line 10 def kind @kind end |
#policy_version ⇒ String? (readonly)
The policy version to use when planning the query.
21 22 23 |
# File 'lib/cerbos/input/resource_query.rb', line 21 def policy_version @policy_version end |
#scope ⇒ String? (readonly)
The policy scope to use when planning the query.
29 30 31 |
# File 'lib/cerbos/input/resource_query.rb', line 29 def scope @scope end |
Instance Method Details
#attributes ⇒ Attributes
Use #attr instead.
Any application-specific attributes describing the resources to be queried that are known in advance.
54 55 56 57 |
# File 'lib/cerbos/input/resource_query.rb', line 54 def attributes Cerbos.deprecation_warning "The `attributes` method is deprecated. Use `attr` instead." attr end |