Class: Mspire::Mzml::Software
- Inherits:
-
Object
- Object
- Mspire::Mzml::Software
- Extended by:
- List
- Includes:
- CV::Paramable
- Defined in:
- lib/mspire/mzml/software.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes included from CV::Paramable
#cv_params, #ref_param_groups, #user_params
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id = "mspire_#{Mspire::VERSION}", version = Mspire::VERSION) {|_self| ... } ⇒ Software
constructor
A new instance of Software.
- #to_xml(builder) ⇒ Object
Methods included from List
Methods included from CV::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!
Constructor Details
#initialize(id = "mspire_#{Mspire::VERSION}", version = Mspire::VERSION) {|_self| ... } ⇒ Software
Returns a new instance of Software.
13 14 15 16 17 |
# File 'lib/mspire/mzml/software.rb', line 13 def initialize(id="mspire_#{Mspire::VERSION}", version=Mspire::VERSION) @id, @version = id, version params_init yield(self) if block_given? end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/mspire/mzml/software.rb', line 11 def id @id end |
#version ⇒ Object
Returns the value of attribute version.
11 12 13 |
# File 'lib/mspire/mzml/software.rb', line 11 def version @version end |
Class Method Details
.from_xml(xml, link) ⇒ Object
26 27 28 29 |
# File 'lib/mspire/mzml/software.rb', line 26 def self.from_xml(xml, link) obj = self.new(xml[:id], xml[:version]) obj.describe_self_from_xml!(xml, link[:ref_hash]) end |
Instance Method Details
#to_xml(builder) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/mspire/mzml/software.rb', line 19 def to_xml(builder) builder.software( id: @id, version: @version) do |sf_n| super(sf_n) end builder end |