Class: Yardi::Utils::PhoneParser
- Inherits:
-
Object
- Object
- Yardi::Utils::PhoneParser
- Defined in:
- lib/yardi/utils/phone_parser.rb
Class Method Summary collapse
-
.parse(phone) ⇒ Array<String>
A single prospect/resident can have have 0 to many <Phone> nodes, so prospect/resident can have three different types: nil if there’s no phone included a Hash representing a single phone number if there’s one phone an Array if there are multiple phones.
Class Method Details
.parse(phone) ⇒ Array<String>
A single prospect/resident can have have 0 to many <Phone> nodes, so prospect/resident can have three different types:
nil if there's no phone included
a Hash representing a single phone number if there's one phone
an Array if there are multiple phones
14 15 16 17 18 19 20 |
# File 'lib/yardi/utils/phone_parser.rb', line 14 def self.parse(phone) if phone.is_a?(Array) phone.map { |ph| ph['PhoneNumber'] }.compact elsif phone && phone['PhoneNumber'] [phone['PhoneNumber']] end end |