Class: MML::Department

Inherits:
Facility show all
Defined in:
lib/mml/common.rb

Instance Attribute Summary

Attributes inherited from Facility

#id, #name

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Department

Returns a new instance of Department.



203
204
205
# File 'lib/mml/common.rb', line 203

def initialize(args = {})
  super
end

Instance Method Details

#to_xmlObject



207
208
209
210
211
212
213
214
215
216
217
# File 'lib/mml/common.rb', line 207

def to_xml
  xb = Builder::XmlMarkup.new
  xb.mmlDp :Department do
    name.each do |n|
      attributes = { 'mmlDp:repCode' => n.repCode}
      attributes['mmlDp:tableId'] = n.tableId if n.tableId
      xb.mmlDp :name, n.value, attributes
    end
    xb << id.to_xml if id
  end
end