Class: Closeio::Rails::Contact
- Defined in:
- app/models/closeio/rails/contact.rb
Instance Method Summary collapse
Methods included from Attributes
Instance Method Details
#email ⇒ Object
9 10 11 |
# File 'app/models/closeio/rails/contact.rb', line 9 def email raise NotImplementedError, "You need to implement Closeio::Rails::Contact#email in your own subclass or prepended mixin." end |
#email_addresses ⇒ Object
17 18 19 |
# File 'app/models/closeio/rails/contact.rb', line 17 def email_addresses emails.inject({}) {|h,data| h[data[:email]] = data[:type]; h} end |
#has_login? ⇒ Boolean
5 6 7 |
# File 'app/models/closeio/rails/contact.rb', line 5 def has_login? emails.find {|e| e['type'] == 'other'}.present? end |
#phone_numbers ⇒ Object
13 14 15 |
# File 'app/models/closeio/rails/contact.rb', line 13 def phone_numbers phones.inject({}) {|h, p| h[p['phone_formatted']] = p['type']; h} end |