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
-
#attributes ⇒ 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
-
#initialize(kind:, attributes: {}, policy_version: nil, scope: nil) ⇒ ResourceQuery
constructor
Specify partial details of resources to be queried.
Constructor Details
#initialize(kind:, attributes: {}, policy_version: nil, scope: nil) ⇒ ResourceQuery
Specify partial details of resources to be queried.
37 38 39 40 41 42 |
# File 'lib/cerbos/input/resource_query.rb', line 37 def initialize(kind:, attributes: {}, policy_version: nil, scope: nil) @kind = kind @attributes = Input.coerce_required(attributes, Attributes) @policy_version = policy_version @scope = scope end |
Instance Attribute Details
#attributes ⇒ 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 attributes @attributes 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 |