Class: Hubbado::Policy::Scope
- Inherits:
-
Object
- Object
- Hubbado::Policy::Scope
- Defined in:
- lib/hubbado/policy/scope.rb
Defined Under Namespace
Modules: Substitute
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build ⇒ Object
13 14 15 16 17 |
# File 'lib/hubbado/policy/scope.rb', line 13 def self.build instance = new instance.configure instance end |
.call(record, scope = nil, **options) ⇒ Object
9 10 11 |
# File 'lib/hubbado/policy/scope.rb', line 9 def self.call(record, scope = nil, **) build.(record, scope, **) end |
Instance Method Details
#call(record, scope = nil, **options) ⇒ Object
22 23 24 25 26 |
# File 'lib/hubbado/policy/scope.rb', line 22 def call(record, scope = nil, **) scope ||= self.class.default_scope resolve(record, scope, **) end |