Class: MML::PersonalizedInfo
- Inherits:
-
Object
- Object
- MML::PersonalizedInfo
- Defined in:
- lib/mml/common.rb
Instance Attribute Summary collapse
-
#addresses ⇒ Object
Returns the value of attribute addresses.
-
#department ⇒ Object
Returns the value of attribute department.
-
#emailAddresses ⇒ Object
Returns the value of attribute emailAddresses.
-
#facility ⇒ Object
Returns the value of attribute facility.
-
#id ⇒ Object
Returns the value of attribute id.
-
#personName ⇒ Object
Returns the value of attribute personName.
-
#phones ⇒ Object
Returns the value of attribute phones.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ PersonalizedInfo
constructor
A new instance of PersonalizedInfo.
- #to_xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ PersonalizedInfo
Returns a new instance of PersonalizedInfo.
224 225 226 227 228 |
# File 'lib/mml/common.rb', line 224 def initialize(args = {}) %W(id personName facility department addresses emailAddresses phones).each do |item| send "#{item}=", args[item.to_sym] end end |
Instance Attribute Details
#addresses ⇒ Object
Returns the value of attribute addresses.
222 223 224 |
# File 'lib/mml/common.rb', line 222 def addresses @addresses end |
#department ⇒ Object
Returns the value of attribute department.
222 223 224 |
# File 'lib/mml/common.rb', line 222 def department @department end |
#emailAddresses ⇒ Object
Returns the value of attribute emailAddresses.
222 223 224 |
# File 'lib/mml/common.rb', line 222 def emailAddresses @emailAddresses end |
#facility ⇒ Object
Returns the value of attribute facility.
222 223 224 |
# File 'lib/mml/common.rb', line 222 def facility @facility end |
#id ⇒ Object
Returns the value of attribute id.
221 222 223 |
# File 'lib/mml/common.rb', line 221 def id @id end |
#personName ⇒ Object
Returns the value of attribute personName.
221 222 223 |
# File 'lib/mml/common.rb', line 221 def personName @personName end |
#phones ⇒ Object
Returns the value of attribute phones.
222 223 224 |
# File 'lib/mml/common.rb', line 222 def phones @phones end |
Instance Method Details
#to_xml ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/mml/common.rb', line 238 def to_xml xb = Builder::XmlMarkup.new xb.mmlPsi :PersonalizedInfo do xb << id.to_xml xb.mmlPsi :personName do personName.each do |n| xb << n.to_xml end end xb << facility.to_xml if facility xb << department.to_xml if department xb.mmlPsi :addresses do addresses.each do |address| xb << address.to_xml end end if addresses xb.mmlPsi :emailAddresses do emailAddresses.each do |email| xb.mmlCm :email, email end end if emailAddresses xb.mmlPsi :phones do phones.each do |phone| xb << phone.to_xml end end if phones end end |