Sha256: 73c05c2a8646324897c9e7240fe82f76cd6cb31446107070d98a01144d31cbf1

Contents?: true

Size: 1 KB

Versions: 9

Compression:

Stored size: 1 KB

Contents

require 'mspire/cv/paramable'

module Mspire
  class Mzml

    # need to call to_xml_definition (or use
    # Mspire::Mzml::ReferenceableParamGroupList.list_xml) to get the xml for the
    # object itself (and not a reference).  Merely callying #to_xml will
    # result in a referenceableParamGroupRef being created.
    class ReferenceableParamGroup
      include Mspire::CV::Paramable

      attr_accessor :id

      def initialize(id, opts={params: []} )
        @id = id
        super(opts)
      end

      def to_xml(builder)
        builder.referenceableParamGroupRef(ref: @id)
        builder
      end

      def to_xml_definition(builder)
        builder.referenceableParamGroup(id: @id) do |fc_n|
          params.each {|obj| obj.to_xml(fc_n) }
        end
        builder
      end

      def self.list_xml(objs, builder)
        builder.referenceableParamGroupList(count: objs.size) do |rpgl_n|
          objs.each {|obj| obj.to_xml_definition(rpgl_n) }
        end
        builder
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mspire-0.7.18 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.17 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.13 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.12 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.11 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.10 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.9 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.8 lib/mspire/mzml/referenceable_param_group.rb
mspire-0.7.7 lib/mspire/mzml/referenceable_param_group.rb