Sha256: 066734b4af5aab052bf9a5c42bbb691c891c571c8ad6474ca886d2264a8fbbc7

Contents?: true

Size: 260 Bytes

Versions: 21

Compression:

Stored size: 260 Bytes

Contents

class Agilibox::PhoneNumberSanitizer
  attr_reader :phone_number

  def initialize(phone_number)
    @phone_number = phone_number
  end

  def call
    phone_number.to_s.gsub(/[^0-9+]+/, "").presence
  end

  def self.call(*args)
    new(*args).call
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
agilibox-2.0.0 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.11.0 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.10.5 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.10.2 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.10.1 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.10.0 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.20 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.19 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.18 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.17 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.16 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.15 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.14 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.13 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.12 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.11 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.10 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.9 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.8 app/libs/agilibox/phone_number_sanitizer.rb
agilibox-1.9.7 app/libs/agilibox/phone_number_sanitizer.rb