Class: Mspire::Mzml::Software

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

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 List

list_xml, list_xml_element

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.

Yields:

  • (_self)

Yield Parameters:



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

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#versionObject

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