         if value.indexOf(answer) > -1 then hide_questions = false
     return hide_questions
 
+$ ->
   #call findRules on document ready
-  findRules()
+  cl = new ConditionalLogic
+  cl.findRules()

      clearQuestions(container)
    else
      container.removeClass("conditional-logic-hidden")
      
  #clear questions
  clearQuestions = (container) ->
    container.find("input[type!=hidden]").val("")
        
  #evaluate conditional logic rules
  evaluateRules = (operator, answer, value) ->
    hide_questions = true

class ConditionalLogic

  #scan page and find all objects with conditional logic rules
  findRules: ->
    $("[data-rule]").each ->
      rule = $.parseJSON($(this).attr("data-rule")).rule
      $(rule.conditions).each ->
