Class: Mspire::Mzml::InstrumentConfiguration

Inherits:
Object
  • Object
show all
Extended by:
List
Includes:
CV::Paramable
Defined in:
lib/mspire/mzml/instrument_configuration.rb

Instance Attribute Summary collapse

Attributes included from CV::Paramable

#params

Instance Method Summary collapse

Methods included from List

list_xml, list_xml_element

Methods included from CV::Paramable

#describe!, #describe_many!, #find_param_by_accession, #find_param_value_by_accession, #param_exists_by_accession?

Constructor Details

#initialize(id, components = [], opts = {params: []}) ⇒ InstrumentConfiguration

Returns a new instance of InstrumentConfiguration.



19
20
21
22
23
# File 'lib/mspire/mzml/instrument_configuration.rb', line 19

def initialize(id, components=[], opts={params: []})
  describe_many!(opts[:params])
  @id = id
  @components = components
end

Instance Attribute Details

#componentsObject

a list of Source, Analyzer, Detector objects



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

def components
  @components
end

#idObject

(required) the id that this guy can be referenced from



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

def id
  @id
end

#softwareObject

a single software object associated with the instrument



17
18
19
# File 'lib/mspire/mzml/instrument_configuration.rb', line 17

def software
  @software
end

Instance Method Details

#to_xml(builder) ⇒ Object



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

def to_xml(builder)
  builder.instrumentConfiguration(id: @id) do |inst_conf_n|
    super(builder)
    Mspire::Mzml::Component.list_xml(components, inst_conf_n)
    inst_conf_n.softwareRef(ref: @software.id) if @software
  end
  builder
end