Class: PostalCoder::Formats::CAPostalCode

Inherits:
AbstractFormat show all
Defined in:
lib/postalcoder/formats.rb

Instance Attribute Summary

Attributes inherited from AbstractFormat

#value

Instance Method Summary collapse

Methods inherited from AbstractFormat

#cleanup, #initialize, #to_s

Constructor Details

This class inherits a constructor from PostalCoder::Formats::AbstractFormat

Instance Method Details

#has_valid_form?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/postalcoder/formats.rb', line 94

def has_valid_form?
  value =~ /\A([A-Z][0-9]){3}\Z/
end