class Mspire::Mzml::CV

Constants

DEFAULT_CVS
IMS
MS
UO

the version for UO doesn’t really exist: seen files where they use the download date: DD:MM:YYY. I’m going to use the save date in the header.

Attributes

full_name[RW]

(required) The usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).

id[RW]

(required) The short label to be used as a reference tag with which to refer to this particular Controlled Vocabulary source description (e.g., from the cvLabel attribute, in CVParamType elements).

uri[RW]

(required) The URI for the resource.

version[RW]

(optional) The version of the CV from which the referred-to terms are drawn.

Public Class Methods

from_xml(xml) click to toggle source
# File lib/mspire/mzml/cv.rb, line 37
def self.from_xml(xml)
  self.new(xml[:id], xml[:fullName], xml[:URI], xml[:version])
end
list_xml(objs, builder) click to toggle source
# File lib/mspire/mzml/cv.rb, line 29
def self.list_xml(objs, builder)
  # we don't extend Mzml::List because of custom name below
  builder.cvList(count: objs.size) do |cvl_n|
    objs.each {|obj| obj.to_xml(cvl_n) }
  end
  builder
end
new(id, full_name, uri, version=nil) click to toggle source
# File lib/mspire/mzml/cv.rb, line 18
def initialize(id, full_name, uri, version=nil)
  @id, @full_name, @uri, @version = id, full_name, uri, version
end

Public Instance Methods

to_xml(builder) click to toggle source
# File lib/mspire/mzml/cv.rb, line 22
def to_xml(builder)
  atts = {id: @id, fullName: @full_name, :URI => @uri}
  atts[:version] = @version if @version
  builder.cv( atts )
  builder
end