Class: MML::Phone

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#areaObject

Returns the value of attribute area.



152
153
154
# File 'lib/mml/common.rb', line 152

def area
  @area
end

#cityObject

Returns the value of attribute city.



152
153
154
# File 'lib/mml/common.rb', line 152

def city
  @city
end

#countryObject

Returns the value of attribute country.



152
153
154
# File 'lib/mml/common.rb', line 152

def country
  @country
end

#extensionObject

Returns the value of attribute extension.



152
153
154
# File 'lib/mml/common.rb', line 152

def extension
  @extension
end

#memoObject

Returns the value of attribute memo.



152
153
154
# File 'lib/mml/common.rb', line 152

def memo
  @memo
end

#numberObject

Returns the value of attribute number.



152
153
154
# File 'lib/mml/common.rb', line 152

def number
  @number
end

#telEquipTypeObject

Returns the value of attribute telEquipType.



152
153
154
# File 'lib/mml/common.rb', line 152

def telEquipType
  @telEquipType
end

Instance Method Details

#to_xmlObject



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