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



307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/surveyor/parser.rb', line 307

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 = PermittedParams.new(args[0] || {}).dependency
  if context[:question]
    context[:dependency] = context[:question].dependency = self
  elsif context[:question_group]
    context[:dependency] = context[:question_group].dependency = self
  end
end