Class: GoogleCheckout::Geography::UsZip

Inherits:
Area
  • Object
show all
Defined in:
lib/google-checkout/geography/us_zip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zip_pattern) ⇒ UsZip

Returns a new instance of UsZip.



7
8
9
# File 'lib/google-checkout/geography/us_zip.rb', line 7

def initialize(zip_pattern)
  @zip_pattern = zip_pattern
end

Instance Attribute Details

#zip_patternObject

Returns the value of attribute zip_pattern.



5
6
7
# File 'lib/google-checkout/geography/us_zip.rb', line 5

def zip_pattern
  @zip_pattern
end

Instance Method Details

#to_xmlObject



11
12
13
14
15
16
17
18
# File 'lib/google-checkout/geography/us_zip.rb', line 11

def to_xml
  xml = Builder::XmlMarkup.new
  xml.tag!('us-zip-area') do
    xml.tag!('zip-pattern') do
      xml.text! @zip_pattern
    end
  end
end