Class: Checkpoint::DB::Query::AR
- Inherits:
-
CartesianSelect
- Object
- CartesianSelect
- Checkpoint::DB::Query::AR
- Defined in:
- lib/checkpoint/db/query/ar.rb
Overview
A query object based on agents and resources.
This query finds grants for any supplied agents, for any supplied resources. Its primary purpose is to find which credentials have been granted to an agent on a given resource.
It can take single items or arrays and converts them all to their tokens for query purposes.
Instance Attribute Summary collapse
-
#agents ⇒ Object
readonly
Returns the value of attribute agents.
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Attributes inherited from CartesianSelect
Instance Method Summary collapse
- #conditions ⇒ Object
-
#initialize(agents, resources, scope: Grant) ⇒ AR
constructor
A new instance of AR.
- #parameters ⇒ Object
Methods inherited from CartesianSelect
Constructor Details
Instance Attribute Details
#agents ⇒ Object (readonly)
Returns the value of attribute agents.
14 15 16 |
# File 'lib/checkpoint/db/query/ar.rb', line 14 def agents @agents end |
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
14 15 16 |
# File 'lib/checkpoint/db/query/ar.rb', line 14 def resources @resources end |
Instance Method Details
#conditions ⇒ Object
22 23 24 25 26 27 |
# File 'lib/checkpoint/db/query/ar.rb', line 22 def conditions super.merge( agent_token: agent_params.placeholders, resource_token: resource_params.placeholders ) end |
#parameters ⇒ Object
29 30 31 32 33 34 |
# File 'lib/checkpoint/db/query/ar.rb', line 29 def parameters super.merge(Hash[ agent_params.values + resource_params.values ]) end |