Class: Zm::Client::ContactsCollection

Inherits:
Base::AccountObjectsCollection show all
Defined in:
lib/zm/client/contact/contacts_collection.rb

Overview

collection account contacts

Constant Summary

Constants inherited from Base::ObjectsCollection

Base::ObjectsCollection::METHODS_MISSING_LIST

Instance Attribute Summary

Attributes inherited from Base::ObjectsCollection

#parent

Instance Method Summary collapse

Methods inherited from Base::ObjectsCollection

#all, #all!, #find, #first, #logger, #method_missing, #new, #order, #page, #per_page, #respond_to_missing?

Methods included from Inspector

#inspect, #instance_variables_map, #to_h, #to_s

Constructor Details

#initialize(parent) ⇒ ContactsCollection

Returns a new instance of ContactsCollection.



7
8
9
10
11
12
# File 'lib/zm/client/contact/contacts_collection.rb', line 7

def initialize(parent)
  @child_class = Contact
  @builder_class = ContactBuilder
  @folder_id = nil
  super(parent)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zm::Client::Base::ObjectsCollection

Instance Method Details

#folder(folder) ⇒ Object



14
15
16
17
18
# File 'lib/zm/client/contact/contacts_collection.rb', line 14

def folder(folder)
  return self unless folder.is_a?(Zm::Client::Folder)

  folder_id(folder.id)
end

#folder_id(folder_id) ⇒ Object



20
21
22
23
24
25
# File 'lib/zm/client/contact/contacts_collection.rb', line 20

def folder_id(folder_id)
  return self if @folder_id == folder_id

  @folder_id = folder_id
  self
end