Class: MML::Address
- Inherits:
-
Object
- Object
- MML::Address
- Defined in:
- lib/mml/common.rb
Instance Attribute Summary collapse
-
#addressClass ⇒ Object
Returns the value of attribute addressClass.
-
#city ⇒ Object
Returns the value of attribute city.
-
#countryCode ⇒ Object
Returns the value of attribute countryCode.
-
#full ⇒ Object
Returns the value of attribute full.
-
#homeNumber ⇒ Object
Returns the value of attribute homeNumber.
-
#prefecture ⇒ Object
Returns the value of attribute prefecture.
-
#repCode ⇒ Object
Returns the value of attribute repCode.
-
#tableId ⇒ Object
Returns the value of attribute tableId.
-
#town ⇒ Object
Returns the value of attribute town.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Address
constructor
A new instance of Address.
- #to_xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Address
Returns a new instance of Address.
123 124 125 126 127 |
# File 'lib/mml/common.rb', line 123 def initialize(args = {}) %W(repCode addressClass tableId full homeNumber town city prefecture zip countryCode).each do |item| self.send("#{item}=", args[item.to_sym]) end end |
Instance Attribute Details
#addressClass ⇒ Object
Returns the value of attribute addressClass.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def addressClass @addressClass end |
#city ⇒ Object
Returns the value of attribute city.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def city @city end |
#countryCode ⇒ Object
Returns the value of attribute countryCode.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def countryCode @countryCode end |
#full ⇒ Object
Returns the value of attribute full.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def full @full end |
#homeNumber ⇒ Object
Returns the value of attribute homeNumber.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def homeNumber @homeNumber end |
#prefecture ⇒ Object
Returns the value of attribute prefecture.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def prefecture @prefecture end |
#repCode ⇒ Object
Returns the value of attribute repCode.
120 121 122 |
# File 'lib/mml/common.rb', line 120 def repCode @repCode end |
#tableId ⇒ Object
Returns the value of attribute tableId.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def tableId @tableId end |
#town ⇒ Object
Returns the value of attribute town.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def town @town end |
#zip ⇒ Object
Returns the value of attribute zip.
121 122 123 |
# File 'lib/mml/common.rb', line 121 def zip @zip end |
Instance Method Details
#to_xml ⇒ Object
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/mml/common.rb', line 134 def to_xml xb = Builder::XmlMarkup.new attributes = { 'mmlAd:repCode' => repCode } attributes['mmlAd:addressClass'] = addressClass attributes['mmlAd:tableId'] = tableId xb.mmlAd :Address, attributes do xb.mmlAd :homeNumber, homeNumber if homeNumber xb.mmlAd :town, town if town xb.mmlAd :city, city if city xb.mmlAd :prefecture, prefecture if prefecture xb.mmlAd :full, full if full xb.mmlAd :zip, zip if zip xb.mmlAd :countryCode, countryCode if countryCode end end |