class Mspire::Mzml::DataProcessing
Attributes
id[RW]
processing_methods[RW]
Public Class Methods
from_xml(xml, link)
click to toggle source
# File lib/mspire/mzml/data_processing.rb, line 31 def self.from_xml(xml, link) processing_methods = xml.children.map do |pm_n| ProcessingMethod.new(link[:software_hash][pm_n[:softwareRef]]) .describe_self_from_xml!(pm_n, link[:ref_hash]) end self.new(xml[:id], processing_methods) end
new(id, processing_methods=[]) { |self| ... }
click to toggle source
yields self if given a block
# File lib/mspire/mzml/data_processing.rb, line 12 def initialize(id, processing_methods=[]) @id, @processing_methods = id, processing_methods yield(self) if block_given? end
Public Instance Methods
order(processing_method)
click to toggle source
returns the order of the processing method
# File lib/mspire/mzml/data_processing.rb, line 27 def order(processing_method) processing_methods.index(processing_method) end
to_xml(builder)
click to toggle source
# File lib/mspire/mzml/data_processing.rb, line 17 def to_xml(builder) builder.dataProcessing( id: @id ) do |dp_n| processing_methods.each_with_index do |processing_method,order| processing_method.to_xml(dp_n, order) end end builder end