Class: Shark::Group
- Extended by:
- ContactService::Resource
- Defined in:
- lib/shark/group.rb
Instance Method Summary collapse
- #contact?(contact_id) ⇒ Boolean (also: #has_contact?)
Methods inherited from Base
Instance Method Details
#contact?(contact_id) ⇒ Boolean Also known as: has_contact?
9 10 11 12 13 14 |
# File 'lib/shark/group.rb', line 9 def contact?(contact_id) contacts = relationships['contacts'] return false if contacts.blank? || contacts['data'].blank? contacts['data'].any? { |c| c['type'] == 'contacts' && c['id'].to_s == contact_id.to_s } end |