Sha256: cfef943ea514ac4d6e735b03a7c4365b63da4b0a393597e8edb875197e16930a

Contents?: true

Size: 771 Bytes

Versions: 9

Compression:

Stored size: 771 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)
        super(opts)
        block.call(self) if block
      end

      def to_xml(builder)
        builder.scanList(count: self.size) do |sl_n|
          super(sl_n)
          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

9 entries across 9 versions & 1 rubygems

Version Path
mspire-0.7.18 lib/mspire/mzml/scan_list.rb
mspire-0.7.17 lib/mspire/mzml/scan_list.rb
mspire-0.7.13 lib/mspire/mzml/scan_list.rb
mspire-0.7.12 lib/mspire/mzml/scan_list.rb
mspire-0.7.11 lib/mspire/mzml/scan_list.rb
mspire-0.7.10 lib/mspire/mzml/scan_list.rb
mspire-0.7.9 lib/mspire/mzml/scan_list.rb
mspire-0.7.8 lib/mspire/mzml/scan_list.rb
mspire-0.7.7 lib/mspire/mzml/scan_list.rb