Class: Google4R::Checkout::PostalArea
- Defined in:
- lib/google4r/checkout/shared.rb
Overview
Instances of PostalArea represent a geographical region somewhere in the world.
Instance Attribute Summary collapse
-
#country_code ⇒ Object
String; The two-letter ISO 3166 country code.
-
#postal_code_pattern ⇒ Object
String; Postal code or a range of postal codes for a specific country.
Instance Method Summary collapse
-
#initialize(country_code = nil, postal_code_pattern = nil) ⇒ PostalArea
constructor
Parameters.
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
696 697 698 699 |
# File 'lib/google4r/checkout/shared.rb', line 696 def initialize(country_code=nil, postal_code_pattern=nil) @country_code = country_code @postal_code_pattern = postal_code_pattern end |
Instance Attribute Details
#country_code ⇒ Object
String; The two-letter ISO 3166 country code.
678 679 680 |
# File 'lib/google4r/checkout/shared.rb', line 678 def country_code @country_code end |
#postal_code_pattern ⇒ Object
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*’
690 691 692 |
# File 'lib/google4r/checkout/shared.rb', line 690 def postal_code_pattern @postal_code_pattern end |