Class: GoogleCheckout::Geography::Postal
- Defined in:
- lib/google-checkout/geography/postal.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
Returns the value of attribute country.
-
#postal_pattern ⇒ Object
Returns the value of attribute postal_pattern.
Instance Method Summary collapse
-
#initialize(country, postal_pattern = nil) ⇒ Postal
constructor
A new instance of Postal.
- #to_xml ⇒ Object
Constructor Details
#initialize(country, postal_pattern = nil) ⇒ Postal
Returns a new instance of Postal.
7 8 9 10 |
# File 'lib/google-checkout/geography/postal.rb', line 7 def initialize(country, postal_pattern=nil) @country = country @postal_pattern = postal_pattern end |
Instance Attribute Details
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/google-checkout/geography/postal.rb', line 5 def country @country end |
#postal_pattern ⇒ Object
Returns the value of attribute postal_pattern.
5 6 7 |
# File 'lib/google-checkout/geography/postal.rb', line 5 def postal_pattern @postal_pattern end |
Instance Method Details
#to_xml ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/google-checkout/geography/postal.rb', line 12 def to_xml xml = Builder::XmlMarkup.new xml.tag!('postal-area') do xml.tag!('country-code') do xml.text! @country end xml.tag!('postal-code-pattern') do xml.text! @postal_pattern end if @postal_pattern end end |