Module: SurveyorParserDependencyConditionMethods
- Defined in:
- lib/surveyor/parser.rb
Overview
DependencyCondition model
Instance Method Summary collapse
Instance Method Details
#parse_and_build(context, args, original_method, reference_identifier) ⇒ Object
290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/surveyor/parser.rb', line 290 def parse_and_build(context, args, original_method, reference_identifier) # clear context context.delete :dependency_condition # build and set context a0, a1, a2 = args self.attributes = ({ :operator => a1 || "==", :question_reference => a0.to_s.gsub(/^q_/, ""), :rule_key => reference_identifier }.merge( a2.is_a?(Hash) ? a2 : { :answer_reference => a2.to_s.gsub(/^a_/, "") })) context[:dependency].dependency_conditions << context[:dependency_condition] = self context[:dependency_conditions] << self end |