Method: IfRelationship#to_ruby

Defined in:
lib/cauldron/if_relationship.rb

#to_ruby(variables) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cauldron/if_relationship.rb', line 9

def to_ruby(variables)

  # Add the arguments
  result = ''
  @problems.each_with_index do |x,i|
    result += '  if '+variables[0].to_s+' == '+quote(x.arguments[0])+"\n"
    result += '    return '+quote(x.response)+"\n"
    result += '  end'+"\n"
  end    
  result
end