Class: Mspire::Mzml::ReferenceableParamGroup

Inherits:
Object
  • Object
show all
Includes:
CV::Paramable
Defined in:
lib/mspire/mzml/referenceable_param_group.rb

Overview

need to call to_xml_definition (or use Mspire::Mzml::ReferenceableParamGroupList.list_xml) to get the xml for the object itself (and not a reference). Merely callying #to_xml will result in a referenceableParamGroupRef being created.

Instance Attribute Summary collapse

Attributes included from CV::Paramable

#cv_params, #ref_param_groups, #user_params

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CV::Paramable

#accessionable_params, #describe!, #describe_many!, #fetch, #fetch_by_accession, #param?, #param_by_accession, #params, #params?

Constructor Details

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

Returns a new instance of ReferenceableParamGroup.



15
16
17
18
# File 'lib/mspire/mzml/referenceable_param_group.rb', line 15

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



13
14
15
# File 'lib/mspire/mzml/referenceable_param_group.rb', line 13

def id
  @id
end

Class Method Details

.list_xml(objs, builder) ⇒ Object



32
33
34
35
36
37
# File 'lib/mspire/mzml/referenceable_param_group.rb', line 32

def self.list_xml(objs, builder)
  builder.referenceableParamGroupList(count: objs.size) do |rpgl_n|
    objs.each {|obj| obj.to_xml_definition(rpgl_n) }
  end
  builder
end

Instance Method Details

#to_xml(builder) ⇒ Object



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

def to_xml(builder)
  builder.referenceableParamGroupRef(ref: @id)
  builder
end

#to_xml_definition(builder) ⇒ Object



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

def to_xml_definition(builder)
  builder.referenceableParamGroup(id: @id) do |fc_n|
    params.each {|obj| obj.to_xml(fc_n) }
  end
  builder
end