Class: PermissionSettings::Verify
- Inherits:
-
Object
- Object
- PermissionSettings::Verify
- Defined in:
- lib/permission_settings/verify.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(permission_keys, role, resource, &block) ⇒ Verify
constructor
A new instance of Verify.
Constructor Details
#initialize(permission_keys, role, resource, &block) ⇒ Verify
Returns a new instance of Verify.
8 9 10 11 12 13 14 |
# File 'lib/permission_settings/verify.rb', line 8 def initialize(, role, resource, &block) @permission_keys = .map(&:to_s) @role = role @resource = resource @block = block @scope = PermissionSettings.configuration.scope_name(resource.class) end |
Class Method Details
.call(permission_keys = [], role: nil, resource: nil, &block) ⇒ Object
16 17 18 |
# File 'lib/permission_settings/verify.rb', line 16 def self.call( = [], role: nil, resource: nil, &block) new(, role, resource, &block).call end |
Instance Method Details
#call ⇒ Object
20 21 22 23 |
# File 'lib/permission_settings/verify.rb', line 20 def call raise_not_found_error if .nil? end |