Class: Three::Evaluator
- Inherits:
-
Object
- Object
- Three::Evaluator
- Defined in:
- lib/three/evaluator.rb
Instance Attribute Summary collapse
-
#rescue_errors ⇒ Object
Returns the value of attribute rescue_errors.
Instance Method Summary collapse
- #allowed?(subject, permissions_to_check, target = nil) ⇒ Boolean
-
#initialize(rules) ⇒ Evaluator
constructor
A new instance of Evaluator.
Constructor Details
#initialize(rules) ⇒ Evaluator
Returns a new instance of Evaluator.
7 8 9 10 |
# File 'lib/three/evaluator.rb', line 7 def initialize(rules) @rescue_errors = true @rules = a_single_array_was_provided?(rules) ? rules[0] : rules end |
Instance Attribute Details
#rescue_errors ⇒ Object
Returns the value of attribute rescue_errors.
5 6 7 |
# File 'lib/three/evaluator.rb', line 5 def rescue_errors @rescue_errors end |
Instance Method Details
#allowed?(subject, permissions_to_check, target = nil) ⇒ Boolean
12 13 14 15 |
# File 'lib/three/evaluator.rb', line 12 def allowed? subject, , target = nil = convert_to_an_array_if_its_not , subject, target end |