Sha256: 97af68a666935660db0843677844cf45c64a8727d9806fbc12a581a4161724a9

Contents?: true

Size: 673 Bytes

Versions: 39

Compression:

Stored size: 673 Bytes

Contents

module Mspire
  class Mzml
    # Methods for simple List objects (scanList, instrumentConfigurationList,
    # etc.)
    module List
      def list_xml_element
        return @list_xml_element if @list_xml_element
        @list_xml_element = self.to_s.split('::').last << "List"
        @list_xml_element[0] = @list_xml_element[0].downcase
        @list_xml_element
      end

      def list_xml(objects, builder, tagname=nil)
        # InstrumentConfiguration -> instrumentConfigurationList
        builder.tag!(tagname || list_xml_element, count: objects.size) do |n|
          objects.each {|obj| obj.to_xml(n) }
        end
        builder
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
mspire-0.10.8.0 lib/mspire/mzml/list.rb
mspire-0.10.7.3 lib/mspire/mzml/list.rb
mspire-0.10.7.2 lib/mspire/mzml/list.rb
mspire-0.10.7.1 lib/mspire/mzml/list.rb
mspire-0.10.7 lib/mspire/mzml/list.rb
mspire-0.10.6 lib/mspire/mzml/list.rb
mspire-0.10.5 lib/mspire/mzml/list.rb
mspire-0.10.4 lib/mspire/mzml/list.rb
mspire-0.10.3 lib/mspire/mzml/list.rb
mspire-0.10.2 lib/mspire/mzml/list.rb
mspire-0.10.1 lib/mspire/mzml/list.rb
mspire-0.10.0 lib/mspire/mzml/list.rb
mspire-0.9.2 lib/mspire/mzml/list.rb
mspire-0.9.1 lib/mspire/mzml/list.rb
mspire-0.9.0 lib/mspire/mzml/list.rb
mspire-0.8.7 lib/mspire/mzml/list.rb
mspire-0.8.6.2 lib/mspire/mzml/list.rb
mspire-0.8.6.1 lib/mspire/mzml/list.rb
mspire-0.8.6 lib/mspire/mzml/list.rb
mspire-0.8.5 lib/mspire/mzml/list.rb