Class SmerfGroup
In: app/models/smerf_group.rb
Parent: SmerfItem

This class contains details about smerf form groups, it derives from SmerfItem.

Each form is divided up into groups of questions, you must have at least one group per form. Here are the fields that are currently available when defining a group:

code:This code must be unique for all groups within the form as it is used to identify each group (mandatory)
name:The name of the group, this is displayed as the group heading (mandatory)
description:Provide more detailed description/instructions for the group (optional)
questions:Defines all the questions contained within this group (mandatory)

Here is the definition for the Personal Details group of the test form:

    personal_details:
      code: 1
      name: Personal Details Group
      description: | This is a brief description of the Personal Details Group
        here we ask you some personal details ...
      questions:
      ...

Methods

clear   new   validate  

Attributes

code  [RW] 
description  [RW] 
name  [RW] 
question_objects  [RW] 

Public Class methods

Clear all class variables

Public Instance methods

This method performs the bulk of the processing. It processes the group definition making sure that all mandatory fields have values. If any questions are found they will be processed and validated.

As it processes the data it also performs validation on the data to make sure all required fields have been specified in the definition file. If any errors are found a RuntimeError exception will be raised.

[Validate]