Sha256: a27e90d1354536f0d81a9cd39469dd673d934df6b6eeb114f7d01f4db49a9295

Contents?: true

Size: 1.17 KB

Versions: 11

Compression:

Stored size: 1.17 KB

Contents

require 'mspire/cv/paramable'
require 'mspire/mzml/data_array'

module Mspire
  class Mzml
    module DataArrayContainerLike
      include Mspire::CV::Paramable

      ###########################################
      # ATTRIBUTES
      ###########################################

      # (required) the spectrum id matching this general pattern: \S+=\S+( \S+=\S+)*)
      attr_accessor :id

      # (required [at xml write time]) the index in the spectrum list
      attr_accessor :index

      # (optional) an Mspire::Mzml::DataProcessing object
      attr_accessor :data_processing

      ###########################################
      # SUBELEMENTS
      ###########################################

      # (optional) an array of Mspire::Mzml::DataArray
      attr_accessor :data_arrays

      def default_array_length
        if @data_arrays
          if @data_arrays.first
            @data_arrays.first.size
          else
            0
          end
        else
          0
        end
      end

      # returns a hash with id, index, defaultArrayLength
      def data_array_xml_atts
        {index: @index, id: @id, defaultArrayLength: default_array_length}
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mspire-0.9.2 lib/mspire/mzml/data_array_container_like.rb
mspire-0.9.1 lib/mspire/mzml/data_array_container_like.rb
mspire-0.9.0 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.7 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.6.2 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.6.1 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.6 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.5 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.4 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.3 lib/mspire/mzml/data_array_container_like.rb
mspire-0.8.2 lib/mspire/mzml/data_array_container_like.rb