Class: Veto::ProcCondition

Inherits:
Condition show all
Defined in:
lib/veto/conditions/proc_condition.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


7
8
9
# File 'lib/veto/conditions/proc_condition.rb', line 7

def pass?(cco)
  !!@proc.call(cco.entity)
end