Module: Mspire::Mzml::List

Overview

Methods for simple List objects (scanList, instrumentConfigurationList, etc.)

Instance Method Summary collapse

Instance Method Details

#list_xml(objects, builder, tagname = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/mspire/mzml/list.rb', line 14

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

#list_xml_elementObject



7
8
9
10
11
12
# File 'lib/mspire/mzml/list.rb', line 7

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