Class: Google4R::Checkout::PostalArea

Inherits:
Area
  • Object
show all
Defined in:
lib/google4r/checkout/shared.rb

Overview

Instances of PostalArea represent a geographical region somewhere in the world.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(country_code = nil, postal_code_pattern = nil) ⇒ PostalArea

Parameters

country_code should be a two-letter ISO 3166 country code postal_code_pattern should be a full or partial postcode string, using * as a wildcard



685
686
687
688
# File 'lib/google4r/checkout/shared.rb', line 685

def initialize(country_code=nil, postal_code_pattern=nil)     
  @country_code = country_code
  @postal_code_pattern = postal_code_pattern
end

Instance Attribute Details

#country_codeObject

String; The two-letter ISO 3166 country code.



667
668
669
# File 'lib/google4r/checkout/shared.rb', line 667

def country_code
  @country_code
end

#postal_code_patternObject

String; Postal code or a range of postal codes for a specific country. To specify a range of postal codes, use an asterisk as a wildcard operator. For example, you can provide a postal_code_pattern value of “SW*” to indicate that a shipping option is available or a tax rule applies in any postal code beginning with the characters SW.

Example

area = PostalArea.new(‘DE’) area.postal_code_pattern = ‘10*’



679
680
681
# File 'lib/google4r/checkout/shared.rb', line 679

def postal_code_pattern
  @postal_code_pattern
end