Sha256: 4f3bf07ef09b6e2712ccf8acc3725ba7f845bc300957b92f29e1e25ff5430c92

Contents?: true

Size: 201 Bytes

Versions: 5

Compression:

Stored size: 201 Bytes

Contents

module Decanter
  module Parser
    class PhoneParser < ValueParser
      REGEX = /\d/

      allow Fixnum

      parser do |val, options|
        val.scan(REGEX).join.to_s
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decanter-0.9.0 lib/decanter/parser/phone_parser.rb
decanter-0.8.2 lib/decanter/parser/phone_parser.rb
decanter-0.8.1 lib/decanter/parser/phone_parser.rb
decanter-0.8.0 lib/decanter/parser/phone_parser.rb
decanter-0.7.2 lib/decanter/parser/phone_parser.rb