Method: RussianPhone::Number#==

Defined in:
lib/russian_phone/number.rb

#==(other) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/russian_phone/number.rb', line 12

def ==(other)
  if other.class == self.class
    # (other.phone == self.phone && other.options == self.options)
    other.to_s == to_s
  elsif other.class == String
    parsed = RussianPhone::Number.new(other)
    parsed.to_s == to_s
    # parsed.phone == self.phone && parsed.options == self.options
  else
    false
  end
end