Module: PactBroker::Repositories::Scopes
- Included in:
- Deployments::DeployedVersionService, Deployments::EnvironmentService, Deployments::ReleasedVersionService, Integrations::Repository, Integrations::Service, Pacticipants::Repository, Pacts::PactsForVerificationRepository, Verifications::Repository, Versions::BranchRepository
- Defined in:
- lib/pact_broker/repositories/scopes.rb
Instance Method Summary collapse
- #scope_for(scope) ⇒ Object
-
#unscoped(scope) ⇒ Object
For the times when it doesn’t make sense to use the scoped class, this is a way to indicate that it is an intentional use.
- #with_no_scope ⇒ Object
Instance Method Details
#scope_for(scope) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/pact_broker/repositories/scopes.rb', line 11 def scope_for(scope) if @unscoped == true scope else PactBroker.policy_scope!(scope) end end |
#unscoped(scope) ⇒ Object
For the times when it doesn’t make sense to use the scoped class, this is a way to indicate that it is an intentional use
21 22 23 |
# File 'lib/pact_broker/repositories/scopes.rb', line 21 def unscoped(scope) scope end |
#with_no_scope ⇒ Object
4 5 6 7 8 9 |
# File 'lib/pact_broker/repositories/scopes.rb', line 4 def with_no_scope @unscoped = true yield self ensure @unscoped = false end |