Class: Checken::DSL::PermissionDSL
- Inherits:
-
Object
- Object
- Checken::DSL::PermissionDSL
- Defined in:
- lib/checken/dsl/permission_dsl.rb
Instance Method Summary collapse
- #context(*contexts) ⇒ Object
- #context!(*contexts) ⇒ Object
- #depends_on(path) ⇒ Object
- #include_rule(key, options = {}, &block) ⇒ Object
-
#initialize(permission) ⇒ PermissionDSL
constructor
A new instance of PermissionDSL.
- #requires_object(*names) ⇒ Object
- #rule(key, &block) ⇒ Object
Constructor Details
#initialize(permission) ⇒ PermissionDSL
Returns a new instance of PermissionDSL.
5 6 7 |
# File 'lib/checken/dsl/permission_dsl.rb', line 5 def initialize() = end |
Instance Method Details
#context(*contexts) ⇒ Object
27 28 29 30 31 |
# File 'lib/checken/dsl/permission_dsl.rb', line 27 def context(*contexts) contexts.each do |context| .add_context(context) end end |
#context!(*contexts) ⇒ Object
33 34 35 36 |
# File 'lib/checken/dsl/permission_dsl.rb', line 33 def context!(*contexts) .remove_all_contexts context(*contexts) end |
#depends_on(path) ⇒ Object
13 14 15 |
# File 'lib/checken/dsl/permission_dsl.rb', line 13 def depends_on(path) .add_dependency(path) end |
#include_rule(key, options = {}, &block) ⇒ Object
17 18 19 |
# File 'lib/checken/dsl/permission_dsl.rb', line 17 def include_rule(key, = {}, &block) .include_rule(key, , &block) end |
#requires_object(*names) ⇒ Object
21 22 23 24 25 |
# File 'lib/checken/dsl/permission_dsl.rb', line 21 def requires_object(*names) names.each do |name| .add_required_object_type(name) end end |
#rule(key, &block) ⇒ Object
9 10 11 |
# File 'lib/checken/dsl/permission_dsl.rb', line 9 def rule(key, &block) .add_rule(key, &block) end |