Class: MML::Phone
- Inherits:
-
Object
- Object
- MML::Phone
- Defined in:
- lib/mml/common.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
Returns the value of attribute area.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#number ⇒ Object
Returns the value of attribute number.
-
#telEquipType ⇒ Object
Returns the value of attribute telEquipType.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Phone
constructor
A new instance of Phone.
- #to_xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Phone
Returns a new instance of Phone.
154 155 156 157 158 |
# File 'lib/mml/common.rb', line 154 def initialize(args = {}) %W(telEquipType area city number extension country memo).each do |item| self.send("#{item}=", args[item.to_sym]) end end |
Instance Attribute Details
#area ⇒ Object
Returns the value of attribute area.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def area @area end |
#city ⇒ Object
Returns the value of attribute city.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def country @country end |
#extension ⇒ Object
Returns the value of attribute extension.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def extension @extension end |
#memo ⇒ Object
Returns the value of attribute memo.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def memo @memo end |
#number ⇒ Object
Returns the value of attribute number.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def number @number end |
#telEquipType ⇒ Object
Returns the value of attribute telEquipType.
152 153 154 |
# File 'lib/mml/common.rb', line 152 def telEquipType @telEquipType end |
Instance Method Details
#to_xml ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/mml/common.rb', line 160 def to_xml xb = Builder::XmlMarkup.new attributes = {'mmlPh:telEquipType' => telEquipType} if telEquipType xb.mmlPh :Phone, attributes do xb.mmlPh :area, area if area xb.mmlPh :city, city if city xb.mmlPh :number, number if number xb.mmlPh :extension, extension if extension xb.mmlPh :country, country if country xb.mmlPh :memo, memo if memo end end |