Class: OmniScrapper::Normalizers::Phone

Inherits:
Base
  • Object
show all
Defined in:
lib/omni_scrapper/normalizers/phone.rb

Instance Attribute Summary

Attributes inherited from Base

#value

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OmniScrapper::Normalizers::Base

Instance Method Details

#normalizedObject



6
7
8
9
# File 'lib/omni_scrapper/normalizers/phone.rb', line 6

def normalized
  # TODO: raise exception if phone not presetn
  value.scan(/([0-9 \-\(\)]{10,})/).flatten.last.gsub(/[ \-\(\)]/, '')
end