Class: Veto::ProcCondition
- Defined in:
- lib/veto/conditions/proc_condition.rb
Instance Method Summary collapse
-
#initialize(proc) ⇒ ProcCondition
constructor
A new instance of ProcCondition.
- #pass?(cco) ⇒ Boolean
Constructor Details
#initialize(proc) ⇒ ProcCondition
Returns a new instance of ProcCondition.
3 4 5 |
# File 'lib/veto/conditions/proc_condition.rb', line 3 def initialize(proc) @proc = proc end |
Instance Method Details
#pass?(cco) ⇒ Boolean
7 8 9 |
# File 'lib/veto/conditions/proc_condition.rb', line 7 def pass?(cco) !!@proc.call(cco.entity) end |