Class: Bright::PhoneNumber
Constant Summary collapse
- TYPES =
["Cell", "Home", "Work", "Other"]
Instance Method Summary collapse
Methods inherited from Model
#assign_attributes, attribute_names, #initialize, #to_json
Constructor Details
This class inherits a constructor from Bright::Model
Instance Method Details
#extension=(number) ⇒ Object
15 16 17 |
# File 'lib/bright/phone_number.rb', line 15 def extension=(number) @extension = number.gsub(/[^0-9]/, "").strip end |
#phone_number=(number) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/bright/phone_number.rb', line 7 def phone_number=(number) number_a = number.to_s.split(/x|X/) if number_a.size == 2 @extension = number_a.last.gsub(/[^0-9]/, "").strip end @phone_number = number_a.first.gsub(/[^0-9]/, "").strip end |