Sha256: 675456832de008c37658a200aa9b40fae7b32e59b477835e483284ebde6018b1

Contents?: true

Size: 803 Bytes

Versions: 3

Compression:

Stored size: 803 Bytes

Contents

require 'ms/cv/paramable'

module MS
  class Mzml

    # MUST supply a *child* term of MS:1000570 (spectra combination) only once
    #
    #     e.g.: MS:1000571 (sum of spectra)
    #     e.g.: MS:1000573 (median of spectra)
    #     e.g.: MS:1000575 (mean of spectra)
    #     e.g.: MS:1000795 (no combination)
    class ScanList < Array
      include MS::CV::Paramable

      def initialize(opts={params: []}, &block)
        describe!(*opts[:params])
        block.call(self) if block
      end

      def to_xml(builder)
        builder.scanList(count: self.size) do |sl_n|
          @description.to_xml(sl_n) if @description
          self.each do |scan|
            scan.to_xml(sl_n)
          end
        end
        builder
      end

      alias_method :list_xml, :to_xml
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mspire-0.6.12 lib/ms/mzml/scan_list.rb
mspire-0.6.11 lib/ms/mzml/scan_list.rb
mspire-0.6.9 lib/ms/mzml/scan_list.rb