Module: SurveyorParserDependencyMethods

Defined in:
lib/surveyor/parser.rb

Overview

Dependency model

Instance Method Summary collapse

Instance Method Details

#parse_and_build(context, args, original_method, reference_identifier) ⇒ Object



269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/surveyor/parser.rb', line 269

def parse_and_build(context, args, original_method, reference_identifier)
  # clear context
  [ :dependency,
    :dependency_condition ].each{|k| context.delete k}

  # build and set context
  self.attributes = (args[0] || {})
  if context[:question]
    context[:dependency] = context[:question].dependency = self
  elsif context[:question_group]
    context[:dependency] = context[:question_group].dependency = self
  end
end