Module: SurveyorParserQuestionGroupMethods
- Defined in:
- lib/surveyor/parser.rb
Overview
QuestionGroup model
Instance Method Summary collapse
- #clear(context) ⇒ Object
- #parse_and_build(context, args, original_method, reference_identifier) ⇒ Object
Instance Method Details
#clear(context) ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/surveyor/parser.rb', line 211 def clear(context) [ :question_group, :grid_answers, :question, :dependency, :dependency_condition, :answer, :validation, :validation_condition ].each{|k| context.delete k} context[:grid_answers] = [] end |
#parse_and_build(context, args, original_method, reference_identifier) ⇒ Object
201 202 203 204 205 206 207 208 209 210 |
# File 'lib/surveyor/parser.rb', line 201 def parse_and_build(context, args, original_method, reference_identifier) # clear context clear(context) # build and set context self.attributes = ({ :text => args[0] || "Question Group", :display_type => (original_method =~ /grid|repeater/ ? original_method : "default")}.merge(args[1] || {})) context[:question_group] = self end |