Sha256: 4399107367211510a8fe446e9a2e781637559e9ecd0cfd665cce00394de8d548

Contents?: true

Size: 1 KB

Versions: 23

Compression:

Stored size: 1 KB

Contents

xml.instruct! :xml, :version=>"1.0" , :encoding => 'Shift_JIS'
xml.CRD('version' => "1.0"){
  xml.REFERENCE{
    xml.QUESTION @question.body
    xml.tag! 'ACC-LEVEL', '1'
    xml.tag! 'REG-ID', "#{LibraryGroup.site_config.name}_#{@question.id}"
    xml.ANSWER @question.answers.first.try(:body)
    xml.tag! 'CRT-DATE', @question.created_at.strftime('%Y%m%d')
    if @question.solved?
      xml.SOLUTION 1
    else
      xml.SOLUTION 0
    end
    # xml.KEYWORD @question.tags.collect(&:name).join(' ')
    xml.KEYWORD @question.tags.join(' ')
    xml.CLASS :type => 'NDC'
    xml.tag! 'RES-TYPE'
    xml.tag! 'CON-TYPE'
    @question.answers.each do
      xml.BIBL{
        xml.tag! 'BIBL-DESC'
        xml.tag! 'BIBL-NOTE'
      }
    end
    xml.tag! 'ANS-PROC', @question.answers.first.try(:body)
    xml.REFERRAL
    xml.tag! 'PRE-RES'
    xml.NOTE @question.note
    xml.tag! 'PTN-TYPE'
    if @question.answers.exists?
      xml.CONTRI @question.answers.collect(&:user).collect(&:username).uniq.join(' ')
    end
  }
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
enju_question-0.1.0.pre4 app/views/questions/show_crd.xml.builder
enju_question-0.1.0.pre3 app/views/questions/show_crd.xml.builder
enju_question-0.1.0.pre2 app/views/questions/show_crd.xml.builder
enju_question-0.1.0.pre app/views/questions/show_crd.xml.builder
enju_question-0.0.21 app/views/questions/show_crd.xml.builder
enju_question-0.0.20 app/views/questions/show_crd.xml.builder
enju_question-0.0.19 app/views/questions/show_crd.xml.builder
enju_question-0.0.18 app/views/questions/show_crd.xml.builder
enju_question-0.0.17 app/views/questions/show_crd.xml.builder
enju_question-0.0.16 app/views/questions/show_crd.xml.builder
enju_question-0.0.15 app/views/questions/show_crd.xml.builder
enju_question-0.0.14 app/views/questions/show_crd.xml.builder
enju_question-0.0.13 app/views/questions/show_crd.xml.builder
enju_question-0.0.12 app/views/questions/show_crd.xml.builder
enju_question-0.0.11 app/views/questions/show_crd.xml.builder
enju_question-0.0.10 app/views/questions/show_crd.xml.builder
enju_question-0.0.9 app/views/questions/show_crd.xml.builder
enju_question-0.0.8 app/views/questions/show_crd.xml.builder
enju_question-0.0.7 app/views/questions/show_crd.xml.builder
enju_question-0.0.6 app/views/questions/show_crd.xml.builder