Class: Checkpoint::Permits
- Inherits:
-
Object
- Object
- Checkpoint::Permits
- Defined in:
- lib/checkpoint/permits.rb
Overview
The repository of permits – a simple wrapper for the Sequel Datastore / permits table.
Defined Under Namespace
Instance Method Summary collapse
- #any?(agents, credentials, resources) ⇒ Boolean
- #for(agents, credentials, resources) ⇒ Object
-
#initialize(permits: Checkpoint::DB::Permit) ⇒ Permits
constructor
A new instance of Permits.
Constructor Details
#initialize(permits: Checkpoint::DB::Permit) ⇒ Permits
Returns a new instance of Permits.
15 16 17 |
# File 'lib/checkpoint/permits.rb', line 15 def initialize(permits: Checkpoint::DB::Permit) @permits = permits end |
Instance Method Details
#any?(agents, credentials, resources) ⇒ Boolean
23 24 25 |
# File 'lib/checkpoint/permits.rb', line 23 def any?(agents, credentials, resources) where(agents, credentials, resources).first != nil end |
#for(agents, credentials, resources) ⇒ Object
19 20 21 |
# File 'lib/checkpoint/permits.rb', line 19 def for(agents, credentials, resources) where(agents, credentials, resources).select end |