Class: MML::ExtRef

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ ExtRef

Returns a new instance of ExtRef.



97
98
99
100
101
102
# File 'lib/mml/common.rb', line 97

def initialize(args = {})
  self.contentType = args[:contentType]
  self.medicalRole = args[:medicalRole]
  self.title = args[:title]
  self.href = args[:href]
end

Instance Attribute Details

#contentTypeObject

Returns the value of attribute contentType.



94
95
96
# File 'lib/mml/common.rb', line 94

def contentType
  @contentType
end

#hrefObject

Returns the value of attribute href.



95
96
97
# File 'lib/mml/common.rb', line 95

def href
  @href
end

#medicalRoleObject

Returns the value of attribute medicalRole.



94
95
96
# File 'lib/mml/common.rb', line 94

def medicalRole
  @medicalRole
end

#titleObject

Returns the value of attribute title.



94
95
96
# File 'lib/mml/common.rb', line 94

def title
  @title
end

Instance Method Details

#to_xmlObject



109
110
111
112
113
114
115
116
# File 'lib/mml/common.rb', line 109

def to_xml
  xb = Builder::XmlMarkup.new
  attributes = { 'mmlCm:href' => href }
  attributes['mmlCm:contentType'] = contentType if contentType
  attributes['mmlCm:medicalRole'] = medicalRole if medicalRole
  attributes['mmlCm:title'] = title if title
  xb.mmlCm :extRef, attributes
end