class Mspire::Mzml::Sample

Attributes

id[RW]

A unique identifier across the samples with which to reference this sample description.

name[RW]

An optional name for the sample description, mostly intended as a quick mnemonic.

Public Class Methods

from_xml(xml, link) click to toggle source
# File lib/mspire/mzml/sample.rb, line 29
def self.from_xml(xml, link)
  obj = self.new(xml[:id])
  obj.name = xml[:name]
  obj.describe_self_from_xml!(xml, link[:ref_hash])
end
new(id) { |self| ... } click to toggle source
# File lib/mspire/mzml/sample.rb, line 16
def initialize(id)
  @id = id
  params_init
  yield(self) if block_given?
end

Public Instance Methods

to_xml(builder) click to toggle source
Calls superclass method Mspire::Paramable#to_xml
# File lib/mspire/mzml/sample.rb, line 22
def to_xml(builder)
  builder.sample( id: @id, name: @name ) do |sample_n|
    super(sample_n)
  end
  builder
end