Module: Mspire::Mzml::Component

Includes:
Paramable
Included in:
Analyzer, Detector, Source
Defined in:
lib/mspire/mzml/component.rb

Overview

order is not an intrinsic property of this object, so it

Instance Attribute Summary

Attributes included from Paramable

#cv_params, #ref_param_groups, #user_params

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paramable

#accessionable_params, #describe!, #describe_from_xml!, #describe_many!, #describe_self_from_xml!, #each_accessionable_param, #each_param, #fetch, #fetch_by_accession, #param?, #param_by_accession, #params, #params?, #reject!, #replace!, #replace_many!

Class Method Details

.list_xml(components, builder) ⇒ Object



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

def self.list_xml(components, builder)
  builder.componentList(count: components.size) do |xml_n|
    components.each_with_index do |component, order|
      component.to_xml(xml_n, order)
    end
  end
end

Instance Method Details

#initialize {|_self| ... } ⇒ Object

using custom list_xml, so no extend Mspire::Mzml::List

Yields:

  • (_self)

Yield Parameters:



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

def initialize
  params_init
  yield(self) if block_given?
end

#to_xml(builder, order) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/mspire/mzml/component.rb', line 16

def to_xml(builder, order)
  klass = self.class.to_s.split('::').last
  klass[0] = klass[0].downcase
  builder.tag!(klass, order: order) do |c_n|
    super(c_n)
  end
  builder
end