Sha256: 5f4ce3e1aff4686c7612e3ab9018e36ee0e8cf490539b030ba42600d4d2b5f29
Contents?: true
Size: 455 Bytes
Versions: 6
Compression:
Stored size: 455 Bytes
Contents
module Wagon class PhoneNumber attr_reader :type, :value def self.extract_from_string(string) string.strip =~ /([\)\(\+\s\-\d]+)(\((.*)\))?$/ self.new($3 || 'Home', $1.to_s.strip) end def initialize(type, value) @type, @value = type, value end def ==(other) type == other.type && value == other.value end def to_s self.value end end end
Version data entries
6 entries across 6 versions & 1 rubygems