Sha256: cdc94517fb4f923a6c9556eb896b4703878dd8ec5c57afc303c270ee98b16084

Contents?: true

Size: 855 Bytes

Versions: 13

Compression:

Stored size: 855 Bytes

Contents

require 'mspire/cv/paramable'
require 'mspire/mzml/list'

module Mspire
  class Mzml
    class Sample
      include Mspire::CV::Paramable
      extend Mspire::Mzml::List

      # A unique identifier across the samples with which to reference this sample description.
      attr_accessor :id

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

      def initialize(id)
        @id = id
        params_init
        yield(self) if block_given?
      end

      def to_xml(builder)
        builder.sample( id: @id, name: @name ) do |sample_n|
          super(sample_n)
        end
        builder
      end

      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

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mspire-0.9.2 lib/mspire/mzml/sample.rb
mspire-0.9.1 lib/mspire/mzml/sample.rb
mspire-0.9.0 lib/mspire/mzml/sample.rb
mspire-0.8.7 lib/mspire/mzml/sample.rb
mspire-0.8.6.2 lib/mspire/mzml/sample.rb
mspire-0.8.6.1 lib/mspire/mzml/sample.rb
mspire-0.8.6 lib/mspire/mzml/sample.rb
mspire-0.8.5 lib/mspire/mzml/sample.rb
mspire-0.8.4 lib/mspire/mzml/sample.rb
mspire-0.8.3 lib/mspire/mzml/sample.rb
mspire-0.8.2 lib/mspire/mzml/sample.rb
mspire-0.8.1 lib/mspire/mzml/sample.rb
mspire-0.8.0 lib/mspire/mzml/sample.rb