lib/phone_number/number.rb in phone_number-1.2.0 vs lib/phone_number/number.rb in phone_number-1.3.0
- old
+ new
@@ -44,9 +44,16 @@
def empty?
return (@country_code.nil? || @country_code.empty?) && (@area_code.nil? || @area_code.empty?) && (@subscriber_number_prefix.nil? || @subscriber_number_prefix.empty?) &&
(@subscriber_number_postfix.nil? || @subscriber_number_postfix.empty?) && (@extension.nil? || @extension.empty?)
end
+ def ==( other )
+ return false unless other.instance_of?( self.class )
+ return false unless other.raw == raw
+
+ true
+ end
+
# Creates a phone number based on pattern provided. Defaults to US (NANP) formatting (111) 111-1111.
#
# Symbols:
# %c - country code
# %a - area code
\ No newline at end of file