Class: Zm::Client::FoldersCollection

Inherits:
Base::AccountObjectsCollection show all
Defined in:
lib/zm/client/folder/folders_collection.rb

Overview

collection of folders

Constant Summary

Constants inherited from Base::ObjectsCollection

Base::ObjectsCollection::METHODS_MISSING_LIST

Instance Attribute Summary collapse

Attributes inherited from Base::ObjectsCollection

#parent

Instance Method Summary collapse

Methods inherited from Base::ObjectsCollection

#all, #all!, #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) ⇒ FoldersCollection

Returns a new instance of FoldersCollection.



11
12
13
14
15
16
17
# File 'lib/zm/client/folder/folders_collection.rb', line 11

def initialize(parent)
  @child_class = Folder
  @builder_class = FoldersBuilder
  super(parent)
  @root = nil
  reset_query_params
end

Dynamic Method Handling

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

Instance Attribute Details

#depthObject

Returns the value of attribute depth.



9
10
11
# File 'lib/zm/client/folder/folders_collection.rb', line 9

def depth
  @depth
end

#needGranteeNameObject

Returns the value of attribute needGranteeName.



9
10
11
# File 'lib/zm/client/folder/folders_collection.rb', line 9

def needGranteeName
  @needGranteeName
end

#rootObject (readonly)

Returns the value of attribute root.



7
8
9
# File 'lib/zm/client/folder/folders_collection.rb', line 7

def root
  @root
end

#trObject

Returns the value of attribute tr.



9
10
11
# File 'lib/zm/client/folder/folders_collection.rb', line 9

def tr
  @tr
end

#viewObject

Returns the value of attribute view.



9
10
11
# File 'lib/zm/client/folder/folders_collection.rb', line 9

def view
  @view
end

#visibleObject

Returns the value of attribute visible.



9
10
11
# File 'lib/zm/client/folder/folders_collection.rb', line 9

def visible
  @visible
end

Instance Method Details

#appointmentObject



53
54
55
56
# File 'lib/zm/client/folder/folders_collection.rb', line 53

def appointment
  @view = FolderDefault::CALENDAR[:type]
  self
end

#clearObject



42
43
44
45
46
# File 'lib/zm/client/folder/folders_collection.rb', line 42

def clear
  @all = nil
  @root = nil
  reset_query_params
end

#contactObject



58
59
60
61
# File 'lib/zm/client/folder/folders_collection.rb', line 58

def contact
  @view = FolderDefault::CONTACTS[:type]
  self
end

#documentObject



48
49
50
51
# File 'lib/zm/client/folder/folders_collection.rb', line 48

def document
  @view = FolderDefault::BRIEFCASE[:type]
  self
end

#find(id) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/zm/client/folder/folders_collection.rb', line 19

def find(id)
  folder = @child_class.new(@parent) do |f|
    f.id = id
  end
  folder.reload!
  folder
end

#idsObject



38
39
40
# File 'lib/zm/client/folder/folders_collection.rb', line 38

def ids
  @builder_class.new(@parent, make_query).ids
end

#messageObject



63
64
65
66
# File 'lib/zm/client/folder/folders_collection.rb', line 63

def message
  @view = FolderDefault::INBOX[:type]
  self
end

#taskObject



68
69
70
71
# File 'lib/zm/client/folder/folders_collection.rb', line 68

def task
  @view = FolderDefault::TASKS[:type]
  self
end

#where(view: nil, tr: nil) ⇒ Object



31
32
33
34
35
36
# File 'lib/zm/client/folder/folders_collection.rb', line 31

def where(view: nil, tr: nil)
  @view = view
  @tr = tr
  @all = nil
  self
end