Class: Veto::EntityEvalCondition

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

Instance Method Summary collapse

Constructor Details

#initialize(eval_string) ⇒ EntityEvalCondition

Returns a new instance of EntityEvalCondition.



3
4
5
# File 'lib/veto/conditions/entity_eval_condition.rb', line 3

def initialize(eval_string)
  @eval_string = eval_string
end

Instance Method Details

#pass?(cco) ⇒ Boolean

Returns:

  • (Boolean)


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

def pass?(cco)
  !!cco.entity.instance_eval(@eval_string)
end