Sha256: 01d2d5ac8fa5cade3dc0f00cd46e4a22a6d17fccfd0a1aca28506f8142b41bc0

Contents?: true

Size: 827 Bytes

Versions: 4

Compression:

Stored size: 827 Bytes

Contents

require 'mspire/cv/paramable'

module Mspire
  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 Mspire::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|
          @params.each {|param| param.to_xml(sl_n) } if @params
          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

4 entries across 4 versions & 1 rubygems

Version Path
mspire-0.7.5 lib/mspire/mzml/scan_list.rb
mspire-0.7.4 lib/mspire/mzml/scan_list.rb
mspire-0.7.3 lib/mspire/mzml/scan_list.rb
mspire-0.7.2 lib/mspire/mzml/scan_list.rb