Module: Zm::Client::BelongsToFolder

Included in:
Appointment, Contact, Document, Folder, Message, MountPoint, Task
Defined in:
lib/zm/modules/belongs_to_folder.rb

Instance Method Summary collapse

Instance Method Details

#folderObject



17
18
19
# File 'lib/zm/modules/belongs_to_folder.rb', line 17

def folder
  @folder || folder!
end

#folder!Object



21
22
23
# File 'lib/zm/modules/belongs_to_folder.rb', line 21

def folder!
  @folder = @parent.folders.all.find { |folder| folder.id == @l }
end

#folder=(folder) ⇒ Object



10
11
12
13
14
15
# File 'lib/zm/modules/belongs_to_folder.rb', line 10

def folder=(folder)
  return unless @l != folder.id

  @l = folder.id
  @folder = folder
end

#folder_idObject



6
7
8
# File 'lib/zm/modules/belongs_to_folder.rb', line 6

def folder_id
  @l
end

#move!(new_folder_id) ⇒ Object



25
26
27
28
29
30
# File 'lib/zm/modules/belongs_to_folder.rb', line 25

def move!(new_folder_id)
  new_folder_id = new_folder_id.id if new_folder_id.is_a?(Zm::Client::Folder)
  @parent.sacc.invoke(jsns_builder.to_move(new_folder_id))
  @l = new_folder_id
  folder!
end

#trash!Object



32
33
34
# File 'lib/zm/modules/belongs_to_folder.rb', line 32

def trash!
  @parent.sacc.invoke(jsns_builder.to_trash)
end