Class: Bali::Rule
- Inherits:
-
Object
- Object
- Bali::Rule
- Defined in:
- lib/bali/rule.rb
Overview
for internal use, representing rule
Instance Attribute Summary collapse
-
#auth_val ⇒ Object
auth_val is either :can or :cant.
-
#decider ⇒ Object
if decider is defined, a rule is executed only if decider evaluates to true.
-
#operation ⇒ Object
readonly
what is the operation: create, update, delete, or any other.
Instance Method Summary collapse
- #has_decider? ⇒ Boolean
-
#initialize(auth_val, operation) ⇒ Rule
constructor
A new instance of Rule.
- #is_discouragement? ⇒ Boolean
Constructor Details
#initialize(auth_val, operation) ⇒ Rule
Returns a new instance of Rule.
12 13 14 15 16 |
# File 'lib/bali/rule.rb', line 12 def initialize(auth_val, operation) self.auth_val = auth_val @operation = operation self end |
Instance Attribute Details
#auth_val ⇒ Object
auth_val is either :can or :cant
4 5 6 |
# File 'lib/bali/rule.rb', line 4 def auth_val @auth_val end |
#decider ⇒ Object
if decider is defined, a rule is executed only if decider evaluates to true
10 11 12 |
# File 'lib/bali/rule.rb', line 10 def decider @decider end |
#operation ⇒ Object (readonly)
what is the operation: create, update, delete, or any other
7 8 9 |
# File 'lib/bali/rule.rb', line 7 def operation @operation end |
Instance Method Details
#has_decider? ⇒ Boolean
30 31 32 |
# File 'lib/bali/rule.rb', line 30 def has_decider? self.decider.is_a?(Proc) end |
#is_discouragement? ⇒ Boolean
26 27 28 |
# File 'lib/bali/rule.rb', line 26 def is_discouragement? self.auth_val == :cant end |