Sha256: 76dba23b279e11af064afa43844bdc0d81b80606a570e7481c51515ad121fbe2

Contents?: true

Size: 766 Bytes

Versions: 3

Compression:

Stored size: 766 Bytes

Contents

module SurveyParser
  class SurveySection < SurveyParser::Base
    # Context, Content, Display, Reference, Children, Placeholders
    attr_accessor :id, :parser, :survey_id
    attr_accessor :title, :description
    attr_accessor :reference_identifier, :data_export_identifier, :common_namespace, :common_identitier
    attr_accessor :display_order, :custom_class
    has_children :question_groups, :questions

    def parse_args(args)
      title = args[0]
      {:title => title, :data_export_identifier => Surveyor::Common.to_normalized_string(title)}.merge(args[1] || {})
    end

    # Used to find questions for dependency linking
    def find_question_by_reference(ref_id)
      self.questions.detect{|q| q.reference_identifier == ref_id}
    end
  
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
surveyor-0.14.5 script/surveyor/survey_section.rb
surveyor-0.14.4 script/surveyor/survey_section.rb
surveyor-0.14.3 script/surveyor/survey_section.rb