Class: Veto::ConditionFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/veto/conditions/condition_factory.rb

Class Method Summary collapse

Class Method Details

.new(condition_option) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/veto/conditions/condition_factory.rb', line 3

def self.new(condition_option)
  condition_class = 
    case condition_option
    when String
      EntityEvalCondition
    when Symbol
      ContextMethodCondition
    when Proc
      ProcCondition
    else
      PrimativeCondition
    end
  condition_class.new(condition_option)
end