Class: Mspire::Mzml::Product

Inherits:
Object
  • Object
show all
Extended by:
List
Defined in:
lib/mspire/mzml/product.rb

Overview

The method of product ion selection and activation in a precursor ion scan

this object is NOT paramable, it just contains a single IsolationWindow

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from List

list_xml, list_xml_element

Constructor Details

#initialize(isolation_window = nil) ⇒ Product

Returns a new instance of Product.



14
15
16
# File 'lib/mspire/mzml/product.rb', line 14

def initialize(isolation_window=nil)
  @isolation_window = isolation_window
end

Instance Attribute Details

#isolation_windowObject

Returns the value of attribute isolation_window.



12
13
14
# File 'lib/mspire/mzml/product.rb', line 12

def isolation_window
  @isolation_window
end

Class Method Details

.from_xml(xml, ref_hash) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/mspire/mzml/product.rb', line 24

def self.from_xml(xml, ref_hash)
  isolation_window_n = xml.child
  if isolation_window_n
    iw = Mspire::Mzml::IsolationWindow.from_xml(isolation_window_n, ref_hash)
  end
  self.new(iw)
end

Instance Method Details

#to_xml(builder) ⇒ Object



18
19
20
21
22
# File 'lib/mspire/mzml/product.rb', line 18

def to_xml(builder)
  builder.product do |p_n|
    @isolation_window.to_xml(p_n) if @isolation_window
  end
end