Class: Zm::Client::AppointmentsCollection

Inherits:
Base::ObjectsCollection show all
Defined in:
lib/zm/client/appointment/appointments_collection.rb

Overview

collection of appointments

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!, #attrs, #build_from_entry, #count, #first, #method_missing, #order, #page, #per_page, #respond_to_missing?

Constructor Details

#initialize(parent) ⇒ AppointmentsCollection

Returns a new instance of AppointmentsCollection.



9
10
11
12
13
# File 'lib/zm/client/appointment/appointments_collection.rb', line 9

def initialize(parent)
  @parent = parent
  @more = true
  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

#moreObject

Returns the value of attribute more.



7
8
9
# File 'lib/zm/client/appointment/appointments_collection.rb', line 7

def more
  @more
end

Instance Method Details

#end_at(end_at) ⇒ Object



32
33
34
35
# File 'lib/zm/client/appointment/appointments_collection.rb', line 32

def end_at(end_at)
  @end_at = end_at
  self
end

#find(id) ⇒ Object



15
16
17
18
19
# File 'lib/zm/client/appointment/appointments_collection.rb', line 15

def find(id)
  rep = @parent.sacc.get_msg(@parent.token, id)
  entry = rep[:Body][:GetMsgResponse][:m].first
  AppointmentJsnsInitializer.new(@parent, entry).create
end

#folder_ids(folder_ids) ⇒ Object



43
44
45
46
# File 'lib/zm/client/appointment/appointments_collection.rb', line 43

def folder_ids(folder_ids)
  @folder_ids = folder_ids
  self
end

#folders(folders) ⇒ Object



37
38
39
40
41
# File 'lib/zm/client/appointment/appointments_collection.rb', line 37

def folders(folders)
  @folders = folders
  @folder_ids = @folders.map(&:id)
  self
end

#idsObject



53
54
55
# File 'lib/zm/client/appointment/appointments_collection.rb', line 53

def ids
  search_builder.ids
end

#new {|appointment| ... } ⇒ Object

Yields:

  • (appointment)


21
22
23
24
25
# File 'lib/zm/client/appointment/appointments_collection.rb', line 21

def new
  appointment = Appointment.new(@parent)
  yield(appointment) if block_given?
  appointment
end

#start_at(start_at) ⇒ Object



27
28
29
30
# File 'lib/zm/client/appointment/appointments_collection.rb', line 27

def start_at(start_at)
  @start_at = start_at
  self
end

#where(query) ⇒ Object



48
49
50
51
# File 'lib/zm/client/appointment/appointments_collection.rb', line 48

def where(query)
  @query = query
  self
end